c# 对比两个List 取出不同的
List<SRModel> SRlist= db.SRModels.ToList(); List<SRUserInfoDto> Userlist = DataProcessing(); //对比两个集合中的差异并出来。两种方法取。 var srGorup = Userlist.Where(x => !SRlist.Any(a => x.XiaoShouDaiBiaoBianMa == a.XiaoShouDaiBiaoBianMa)).ToList(); var intolist = Userlist.Where(a => !SRlist.Select(b => b.XiaoShouDaiBiaoBianMa).Contains(a.XiaoShouDaiBiaoBianMa)).ToList