You need to use DefaultIfEmpty()
for the outer join:
from ta in context.test_attempt join uf in context.user_flag on ta.users.USERID equals uf.UserID into g from uf in g.DefaultIfEmpty() select new { ta, uf }
The appearance of from / select above is not needed, just execute the ta
and uf
project in what you need.
source share