2020
12-07
12-07
c# Linq distinct不会调用Equals方法详解
我有以下课程publicclassModInfo:IEquatable<ModInfo>{publicintID{get;set;}publicstringMD5{get;set;}publicboolEquals(ModInfoother){returnother.MD5.Equals(MD5);}publicoverrideintGetHashCode(){returnMD5.GetHashCode();}}我使用如下方法将一些数据加载到该类的列表中:publicvoidReloadEverything(){varbeforeSort=newList<ModInfo>();//Bunchofloadingfromlocalsqli...
继续阅读 >