判断list重复扩展方法

public static bool AreAnyDuplicates<T>(this IEnumerable<T> list)
{
    var hashset = new HashSet<T>();
    return list.Any(e => !hashset.Add(e));
}
原文地址:https://www.cnblogs.com/zwyAndDong/p/13356248.html