Example #1
0
        public static string TableDifference(CompareSideType sideType, ITableSchema schema1, ITableSchema schema2, string[] primaryKeys, string[] exceptColumns)
        {
            //don't compare identity column or computed column
            exceptColumns = schema1.Columns
                            .Where(column => column.IsComputed || (column.IsIdentity && !column.IsPrimary))
                            .Select(column => column.ColumnName)
                            .Union(exceptColumns)
                            .Distinct()
                            .ToArray();

            TableCompare compare = new TableCompare(schema1, schema2)
            {
                SideType      = sideType,
                ExceptColumns = exceptColumns
            };

            IPrimaryKeys keys = new PrimaryKeys(primaryKeys);

            return(compare.Compare(keys));
        }
Example #2
0
 public RowCompare(TableCompare table, DataRow row1, DataRow row2)
 {
     this.table = table;
     Difference(row1, row2);
 }
Example #3
0
 public static string TableDifference(CompareSideType sideType, TableSchema schema1, TableSchema schema2, string[] primaryKeys, string[] exceptColumns)
 {
     TableCompare compare = new TableCompare(schema1, schema2) { SideType = sideType, ExceptColumns = exceptColumns };
     IPrimaryKeys keys = new PrimaryKeys(primaryKeys);
     return compare.Compare(keys);
 }
Example #4
0
 public RowCompare(TableCompare table, DataRow row1, DataRow row2)
 {
     this.table = table;
     Difference(row1, row2);
 }