Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
 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)
 {
 }
Ejemplo n.º 5
0
 public MetaComparisonColumnGroup(IMetaItem existingItem, IMetaItem requiredItem)
     : base(existingItem, requiredItem)
 {
 }
 public MetaComparisonForeignKeyGroup(IMetaItem existingItem, IMetaItem requiredItem)
     : base(existingItem, requiredItem)
 {
 }
Ejemplo n.º 7
0
 public MetaComparisonTableGroup(IMetaItem existingItem, IMetaItem requiredItem)
     : base(existingItem, requiredItem)
 {
     Columns     = new List <MetaComparisonColumnGroup>();
     ForeignKeys = new List <MetaComparisonForeignKeyGroup>();
 }
Ejemplo n.º 8
0
 protected AbstractMetaComparisonGroup(IMetaItem existingItem, IMetaItem requiredItem)
 {
     _existingItem = existingItem;
     _requiredItem = requiredItem;
 }