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

  

上一篇:嵌入式应用开发过程中用到的函数


下一篇:【POI2015】LOG