Source/NFX/DataAccess/CRUD/Table.cs
/// <summary>
/// Compares two rows based on their key fields. Always compares in ascending direction
/// </summary>
Compares two rows based on their key fields. Always compares in ascending direction
Compares two rows based on their key fields . Always compares in ascending direction
public static int CompareRows(Schema schema, Row rowA, Row rowB)
          {
              if (rowA==null && rowB!=null) return -1;
              if (rowA!=null && rowB==null) return 1;
              if (rowA==null && rowB==null) return 0;
              if (object.ReferenceEquals(rowA, rowB)) return 0;
              if (rowA.Schema!=rowB.Schema) return 1;
              foreach(var fld in schema.AnyTargetKeyFieldDefs)
              {
                var obj1 = rowA[fld.Order] as IComparable;
                var obj2 = rowB[fld.Order] as IComparable;
                if (obj1==null && obj2==null) continue;
                if (obj1==null) return -1;
                if (obj2==null) return +1;
                var result = obj1.CompareTo(obj2);
                if (result!=0) return result;
              }
              return 0;
          }
public static int CompareRows ( Schema schema , Row rowA , Row rowB ) { if ( rowA == null && rowB != null ) return - 1 ; if ( rowA != null && rowB == null ) return 1 ; if ( rowA == null && rowB == null ) return 0 ; if ( object . ReferenceEquals ( rowA , rowB ) ) return 0 ; if ( rowA . Schema != rowB . Schema ) return 1 ; foreach ( var fld in schema . AnyTargetKeyFieldDefs ) { var obj1 = rowA [ fld . Order ] as IComparable ; var obj2 = rowB [ fld . Order ] as IComparable ; if ( obj1 == null && obj2 == null ) continue ; if ( obj1 == null ) return - 1 ; if ( obj2 == null ) return + 1 ; var result = obj1 . CompareTo ( obj2 ) ; if ( result != 0 ) return result ; } return 0 ; }
Compares two rows based on their key fields.
Compares two rows based on their key fields .
schema
Schema
rowA
Row
rowB
Row