/// <summary> /// Clona el objeto ColumnConstraints en una nueva instancia. /// </summary> public IndexColumns Clone() { IndexColumns columns = new IndexColumns(Parent); for (int index = 0; index < this.Count; index++) { columns.Add(this[index].Clone(Parent)); } return(columns); }
/// <summary> /// Compara dos campos y devuelve true si son iguales, caso contrario, devuelve false. /// </summary> public static Boolean Compare(IndexColumns origin, IndexColumns destination) { if (destination == null) { throw new ArgumentNullException("destination"); } if (origin == null) { throw new ArgumentNullException("origin"); } if (origin.Count != destination.Count) { return(false); } for (int j = 0; j < origin.Count; j++) { IndexColumn item = destination[origin[j].FullName]; if (item == null) { return(false); } else if (!IndexColumn.Compare(origin[j], item)) { return(false); } } for (int j = 0; j < destination.Count; j++) { IndexColumn item = origin[destination[j].FullName]; if (item == null) { return(false); } else if (!IndexColumn.Compare(destination[j], item)) { return(false); } } return(true); }
public static Boolean CompareExceptIsDisabled(Index origen, Index destino) { if (destino == null) { throw new ArgumentNullException("destino"); } if (origen == null) { throw new ArgumentNullException("origen"); } if (origen.AllowPageLocks != destino.AllowPageLocks) { return(false); } if (origen.AllowRowLocks != destino.AllowRowLocks) { return(false); } if (origen.FillFactor != destino.FillFactor) { return(false); } if (origen.IgnoreDupKey != destino.IgnoreDupKey) { return(false); } if (origen.IsAutoStatistics != destino.IsAutoStatistics) { return(false); } if (origen.IsPadded != destino.IsPadded) { return(false); } if (origen.IsPrimaryKey != destino.IsPrimaryKey) { return(false); } if (origen.IsUniqueKey != destino.IsUniqueKey) { return(false); } if (origen.Type != destino.Type) { return(false); } if (origen.SortInTempDb != destino.SortInTempDb) { return(false); } if (!origen.FilterDefintion.Equals(destino.FilterDefintion)) { return(false); } if (!IndexColumns.Compare(origen.Columns, destino.Columns)) { return(false); } //return true; return(CompareFileGroup(origen, destino)); }
public Index(ISchemaBase parent) : base(parent, Enums.ObjectType.Index) { FilterDefintion = ""; Columns = new IndexColumns(parent); }