public class ProfileDataCompareEqualityComparer : IEqualityComparer<ProfileData>
{
public bool Equals(ProfileData a, ProfileData b)
{
return a.code == b.code && a.ProfileWidth == b.ProfileWidth;
}
public int GetHashCode(ProfileData obj)
{
return obj.name.GetHashCode();
}
}
List对象根据属性去重
最新推荐文章于 2024-07-02 11:04:44 发布