.Maui Blog

Linq – Left Join with VB.Net

Imagine you have to make a left join between the user table and the jobs table, where there may be no items related to the user table in the jobs table.

Dim users = From u In db.Users
            From j In db.Jobs.Where(Function(x) x.UserId = u.Id).DefaultIfEmpty()                        
            Select u
Exit mobile version