📜  left join ef - 任何代码示例

📅  最后修改于: 2022-03-11 14:58:22.648000             🧑  作者: Mango

代码示例1
var query = from u in usergroups
            join p in UsergroupPrices on u.UsergroupID equals p.UsergroupID into gj
            from x in gj.DefaultIfEmpty()
            select new { 
                UsergroupID = u.UsergroupID,
                UsergroupName = u.UsergroupName,
                Price = (x == null ? String.Empty : x.Price) 
            };