C# 集合根据属性去重筛选
2021-01-22 18:14
标签:find tno data div str volist lis class strong 1.单个属性去重筛选 2.多个属性筛选去重(三个属性) C# 集合根据属性去重筛选 标签:find tno data div str volist lis class strong 原文地址:https://www.cnblogs.com/yuanshuo/p/12075881.html//去重筛选
var ChgDtlVoList = datas.Where((x, i) => datas.FindIndex(z => z.ChgId == x.ChgId ) == i).ToList()
//去重筛选
var ChgDtlVoList = datas.Where((x, i) => datas.FindIndex(z => z.ChgId == x.ChgId ) == i).ToList().Where((x, i) => datas.FindIndex(z => z.OdStd == x.OdStd) == i).ToList().Where((x, i) => datas.FindIndex(z => z.BatNo == x.BatNo) == i).ToList();