在linq中使用union和distinct都不起作用,结果发现必须传入一个实现了IEqualityComparer<T>的比较器

    public class CompareUser : IEqualityComparer<UserEntity>
{
public bool Equals(UserEntity x, UserEntity y)
{
if (x == null && y == null)
return false;
return x.Initial == y.Initial;
} public int GetHashCode(UserEntity obj)
{
return obj.ToString().GetHashCode();
}
}

最新文章

  1. UICollectionViewCell--查找cell上的按钮点击后,对应的是哪个cell
  2. 怎么找到苹果App Store的应用程序下载链接地址
  3. angularjs ocLazyLoad分步加载js文件,angularjs ocLazyLoad按需加载js
  4. Mac下载安装Android Studio教程
  5. Swift游戏实战-跑酷熊猫 09 移除场景之外的平台
  6. IL中的栈和闪电的Owin推荐
  7. 数组(Array),二维数组,三维数组
  8. 读书笔记 |Google C++编程风格指南
  9. mysql中explain优化分析
  10. 将QT开发的界面程序封装成DLL,在VC中成功调用
  11. [python]-数据科学库Numpy学习
  12. [转]django-registration quickstart
  13. linux 笔记整理
  14. 设计模式总结篇系列:桥接模式(Bridge)
  15. 【51NOD1965】奇怪的式子 min_25筛
  16. vue 及sass安装
  17. (PMP)解题技巧和典型题目分析(模拟二)
  18. CSS语法基础
  19. 剑指Offer 2. 替换空格 (字符串)
  20. Asp.Net Core 发布异常 502.5 [The Application process failed to Start]

热门文章

  1. oracle的oci和thin区别(数据源)
  2. 初识SQL Server Integration Service
  3. Oracle merge
  4. [SQL]查询及删除重复记录的SQL语句
  5. webrtc中的带宽自适应算法
  6. Iphone [Tab Bar实现多view切换,Picker,DataPicter实现
  7. Codeforces Round #369 (Div. 2) D. Directed Roads dfs求某个联通块的在环上的点的数量
  8. 【jQuery 冻结任意行列】冻结任意行和列的jQuery插件
  9. ajax调用WebServices服务方法和传参调用WebServices注意事项
  10. delphi 对Tmemo指定的行写入