score:8

Accepted answer

you're currently doing an inner join, but you can use defaultifempty() to create a left outer join. this will also return the null records.

var resulttable = from m in messages 
    join i in images on m.imageid equals i.imageid into imgjoin
    from img in imgjoin.defaultifempty()
    select new
    {
        messageid = m.messageid,
        timestamp = m.timestamp,
        text = m.text,
        roomid = m.roomid,
        imageid = m.imageid,
        userid = m.userid,
        path = img != null ? img.path : ""
    };

Related Query