public class r_ver_product_main_att_Compare : IEqualityComparer<r_ver_product_main_att>
{
public bool Equals(r_ver_product_main_att x, r_ver_product_main_att y)
{
if (x == null || y == null)
return false;
if (x.PRODUCT_CODE == y.PRODUCT_CODE)
return true;
else
return false;
}
public int GetHashCode(r_ver_product_main_att obj)
{
if (obj == null)
return 0;
else
return obj.PRODUCT_CODE.GetHashCode();
}
}
//产品编号是否有重复
//LstMainInfo 是List<r_ver_product_main_att> 查询出来的对象
var LstMainInfo2 = (new r_ver_product_main_att_Compare()).ToList();