public TableDelta(Table expected, Table actual) { Missing = expected.Where(x => actual.All(_ => _.Name != x.Name)).ToArray(); Extras = actual.Where(x => expected.All(_ => _.Name != x.Name)).ToArray(); Matched = expected.Where(x => actual.Any(a => Equals(a, x))).ToArray(); Different = expected.Where(x => actual.HasColumn(x.Name) && !x.Equals(actual.ColumnFor(x.Name))).ToArray(); _tableName = expected.Identifier; compareIndices(expected, actual); compareForeignKeys(expected, actual); }
public TableDelta(Table expected, Table actual) { Missing = expected.Where(x => actual.All(_ => _.Name != x.Name)).ToArray(); Extras = actual.Where(x => expected.All(_ => _.Name != x.Name)).ToArray(); Matched = expected.Where(x => actual.Any(a => Equals(a, x))).ToArray(); Different = expected.Where(x => actual.HasColumn(x.Name) && !x.Equals(actual.ColumnFor(x.Name))).ToArray(); _tableName = expected.Identifier; compareIndices(expected, actual); var missingFKs = expected.ForeignKeys.Where(x => !actual.ActualForeignKeys.Contains(x.KeyName)); MissingForeignKeys.AddRange(missingFKs); }