📜  在实体框架 6.0 中左连接 - 无论代码示例

📅  最后修改于: 2022-03-11 15:00:22.998000             🧑  作者: 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) 
            };