码迷,mamicode.com
首页 > Windows程序 > 详细

C# List去重的比较器

时间:2014-10-24 12:36:38      阅读:273      评论:0      收藏:0      [点我收藏+]

标签:io   ar   div   on   cti   as   text   return   c#   

public class user_collection_DistinctBy_userId : IEqualityComparer<User>
{

public bool Equals(User x, User y)
{
if (x.UserId == y.UserId)
{
return true;
}
else
{
return false;
}
}

public int GetHashCode(User obj)
{
return 0;
}
}

C# List去重的比较器

标签:io   ar   div   on   cti   as   text   return   c#   

原文地址:http://www.cnblogs.com/cleverJoe/p/4047630.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!