LingQ 的Distinct使用方法

需要将对象继承 IEqualityComparer<对象类名> 接口

然后实现下面两个方法 

public bool Equals(对象 x, 对象y)
{
return x.ID == y.ID;//比较是否重复的属性
}

public int GetHashCode(VideoInfo obj)
{
return obj.ToString().GetHashCode();
}

 使用:

结果集.Distinct(new 对象() );

原文地址:https://www.cnblogs.com/Gavin-wang/p/4139984.html