List与表的连接查询
作者:互联网
categoryList.ForEach(p => p.Description = "-1"); var zpclist = from t in categoryList let tp = (from p in categoryList.Select(s => s.ParentRowGuid) select p) where !tp.Contains(t.RowGuid) select t; string projectRowGuid = zpclist.FirstOrDefault().ProjectRowGuid; var joined = from g in zpclist join e in dc_DocData.BidSectionShareDocumentEFile.Where(p => p.ProjectRowGuid == projectRowGuid) on g.RowGuid equals e.ParentRowGuid into ge select new { g, ge }; foreach(var j in joined) { if (j.ge.Count() > 0) { j.g.Description = "1"; } else { j.g.Description = "0"; } }
标签:与表,Description,zpclist,List,查询,ge,var,categoryList,select 来源: https://www.cnblogs.com/wangzuofei/p/13143348.html