Linq

                var ids = (from id in ed_ProjectClass.Values select Guid.Parse(id)).ToArray();
                Entity.ProjectClassCollection.Where(p => ids.Contains(p.Id) == false).ToList()
                    .ForEach(p => Entity.ProjectClassCollection.Remove(p));
                ids.Where(p => Entity.ProjectClassCollection.Any(k => k.Id == p) == false).ToList()
                    .ForEach(p => Entity.ProjectClassCollection.Add( this._iProjectClassContract.GetById(p)));

 

posted @ 2015-10-14 19:32  shiningrise  阅读(163)  评论(0编辑  收藏  举报
// 侧边栏目录 // https://blog-static.cnblogs.com/files/douzujun/marvin.nav.my1502.css