public override bool Equals(IMetaItem iMetaItemA, IMetaItem iMetaItemB) { if (iMetaItemA.ItemType == MetaItemType.PrimaryKey && iMetaItemA.ItemType == iMetaItemB.ItemType) { var primaryKeyA = (MetaPrimaryKey)iMetaItemA; var primaryKeyB = (MetaPrimaryKey)iMetaItemB; if (primaryKeyA.ColumnNames.Count != primaryKeyB.ColumnNames.Count) { return(false); } foreach (string columnA in primaryKeyA.ColumnNames) { bool found = false; foreach (string columnB in primaryKeyB.ColumnNames) { if (columnA.Equals(columnB, StringComparison.OrdinalIgnoreCase)) { found = true; break; } } if (!found) { return(false); } } return(true); } return(base.Equals(iMetaItemA, iMetaItemB)); }
private static IMetaComparisonGroup CreateGroupByType(IMetaManipulate metaManipulate, MetaItemType type, IMetaItem existingItem, IMetaItem requiredItem) { switch (type) { case MetaItemType.Column: return(new MetaComparisonColumnGroup(existingItem, requiredItem)); case MetaItemType.ForeignKey: return(new MetaComparisonForeignKeyGroup(existingItem, requiredItem)); case MetaItemType.PrimaryKey: return(new MetaComparisonPrimaryKeyGroup(existingItem, requiredItem)); case MetaItemType.Table: var group = new MetaComparisonTableGroup(existingItem, requiredItem); ProcessTableSubGroups(metaManipulate, group); return(group); default: return(null); } }
public virtual bool Equals(IMetaItem iMetaItemA, IMetaItem iMetaItemB) { return(iMetaItemA.ItemType == iMetaItemB.ItemType && iMetaItemA.Name.Equals(iMetaItemB.Name, StringComparison.OrdinalIgnoreCase)); }
public MetaComparisonPrimaryKeyGroup(IMetaItem existingItem, IMetaItem requiredItem) : base(existingItem, requiredItem) { }
public MetaComparisonColumnGroup(IMetaItem existingItem, IMetaItem requiredItem) : base(existingItem, requiredItem) { }
public MetaComparisonForeignKeyGroup(IMetaItem existingItem, IMetaItem requiredItem) : base(existingItem, requiredItem) { }
public MetaComparisonTableGroup(IMetaItem existingItem, IMetaItem requiredItem) : base(existingItem, requiredItem) { Columns = new List <MetaComparisonColumnGroup>(); ForeignKeys = new List <MetaComparisonForeignKeyGroup>(); }
protected AbstractMetaComparisonGroup(IMetaItem existingItem, IMetaItem requiredItem) { _existingItem = existingItem; _requiredItem = requiredItem; }