Example #1
0
 public virtual int Compare(T x, T y)
 {
     if (ReferenceEquals(x, y))
     {
         return(0);
     }
     if (x == null)
     {
         return(1);
     }
     if (y == null)
     {
         return(-1);
     }
     return(Comparers.Select(e => e.Compare(x, y))
            .FirstOrDefault(e => e != 0));
 }
 public int Compare(T x, T y) =>
 Comparers
 .Select(c => c.Compare(x, y))
 .FirstOrDefault(r => r != 0);