C# 两个实体集合比较获取差异值
两个实体集合比较获取差异值
PLST.Where(x => !plst.Select(y => y.ERPSalesType).Contains(x.ERPSalesType)).Union(plst.Where(x => !PLST.Select(y => y.ERPSalesType).Contains(x.ERPSalesType)));
//将差异值和数据库现有数据比较取交集,获取要删除的数据
var deleteList = PLST.Intersect(deleteAndAddList).ToList();