码迷,mamicode.com
首页 > 其他好文 > 详细

List与表的连接查询

时间:2020-06-16 18:15:14      阅读:64      评论:0      收藏:0      [点我收藏+]

标签:doc   cti   sele   str   pre   连接查询   rip   sel   file   

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";
                    }
                }

  

List与表的连接查询

标签:doc   cti   sele   str   pre   连接查询   rip   sel   file   

原文地址:https://www.cnblogs.com/wangzuofei/p/13143348.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!