Distinct去除集合中的重复项GetHashCode方法没有返回obj.GetHashCode()导致出错 这个自定义类必须继承IEqualityComparer接口,并且实现该接口方法public int GetHashCode(ActionInfo obj)必须返回 正确写法应该是下面这样子