How can I convert properly this SQL to linq
select t1.ProgramID from Program t1 LEFT JOIN ProgramLocation t2 ON t1.ProgramID = t2.ProgramID where t2.Progr
Try this
var progy = ( from u in db.ProgramLocations join b in db.Programs on u.ProgramID equals b.ProgramID into yG from y1 in yG.DefaultIfEmpty() where y1 == null select u.ProgramID ).ToList();
You can check this post on MSDN.
Hope this works for you.