UserInfoComparer.cs 536 B

12345678910111213141516171819202122
  1. using Muchinfo.MTPClient.Data.Model;
  2. using System.Collections.Generic;
  3. namespace Muchinfo.MTPClient.Infrastructure.Comparers
  4. {
  5. public class UserInfoComparer : IEqualityComparer<UserInfo>
  6. {
  7. public bool Equals(UserInfo x, UserInfo y)
  8. {
  9. if (null == x || null == y)
  10. {
  11. return false;
  12. }
  13. return x.UserName == y.UserName;
  14. }
  15. public int GetHashCode(UserInfo obj)
  16. {
  17. return obj.UserName.GetHashCode();
  18. }
  19. }
  20. }