分类:
MVC
// 三表左链接查询 var list2 = oa.studdinfo.GroupJoin(oa.Score, a => a.Number, b => b.Number, (studdinfos, score) => new { studdinfos, Scores = score, }).SelectMany(a => a.Scores.DefaultIfEmpty(), (a(指前面第一个自定义的所有字段,就这而言就是studdinfos和Scores 这两个), b(指是解析的那个表Scores)) => new { studetnnme = a.studdinfos.studetnnme, Number = b.Number }).GroupJoin(oa.UserInfos, a => a.Number, b => b.Number, (STSCOR(跟上面的a道理相同), USER(跟上面的b相同)) => new { stdentname = STSCOR.studetnnme, user = USER }).SelectMany(a => a.user, (a, b) => new { names=a.stdentname, name=b.username, id=b.id, });
评价