DataCompare.cs 563 B

123456789101112131415161718192021
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using WisdomClient.data;
  7. namespace IntelligentControlForsx.Service.AGC
  8. {
  9. public class DataCompare : IEqualityComparer<TsData>
  10. {
  11. public bool Equals(TsData x, TsData y)
  12. {
  13. return x.ts == y.ts;//自定义去重规则,此处将时间戳作为去重规则,相同的就作为重复记录
  14. }
  15. public int GetHashCode(TsData obj)
  16. {
  17. return obj.ts.GetHashCode();
  18. }
  19. }
  20. }