ExchangeDataModelComparer.cs 626 B

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