排名
6
文章
6
粉丝
16
评论
8
{{item.articleTitle}}
{{item.blogName}} : {{item.content}}
ICP备案 :渝ICP备18016597号-1
网站信息:2018-2024TNBLOG.NET
技术交流:群号656732739
联系我们:contact@tnblog.net
公网安备:50010702506256
欢迎加群交流技术
分类:
EF
linq写法:
//linq写法 var query = (from u in oae.Users join p in oae.User_Parent on u.Id equals p.UsersId into jointemp from leftjoin in jointemp.DefaultIfEmpty() select new UserViewModel { UserName = u.UserName, Father = leftjoin.Father, Mother = leftjoin.Mother }).ToList();
lamdba写法:
//lamdba var result = oae.Users.GroupJoin(oae.Score, a => a.Id, b => b.UsersId, (a, b) => new { UserName = a.UserName, scoreList = b }).SelectMany(a => a.scoreList.DefaultIfEmpty(), (a, b) => new { UserName = a.UserName, Sub = b.Sub, Score = b.Score1 }).ToList();
其他写法
欢迎加群讨论技术,群:677373950(满了,可以加,但通过不了),2群:656732739
评价