/// <summary> /// Clona el objeto Table en una nueva instancia. /// </summary> public override ISchemaBase Clone(ISchemaBase objectParent) { var table = new Table(objectParent) { Owner = Owner, Name = Name, Id = Id, Guid = Guid, Status = Status, FileGroup = FileGroup, FileGroupText = FileGroupText, FileGroupStream = FileGroupStream, HasClusteredIndex = HasClusteredIndex, HasChangeTracking = HasChangeTracking, HasChangeTrackingTrackColumn = HasChangeTrackingTrackColumn, HasChangeDataCapture = HasChangeDataCapture, dependenciesCount = DependenciesCount }; table.Columns = Columns.Clone(table); table.Options = Options.Clone(table); table.CompressType = CompressType; table.Triggers = Triggers.Clone(table); table.Indexes = Indexes.Clone(table); table.Partitions = Partitions.Clone(table); table.Constraints = Constraints.Clone(table); return(table); }
/// <summary> /// Adds a set of Substitution objects to this set. /// If conflics are detected, the original SubstitutionSet object in not changed. /// </summary> /// <param name="substitutions">The Substitution objects set to add.</param> /// <returns>True if all the substitutions were added to this object. False if conflics were detected.</returns> public bool AddSubstitutions(IEnumerable <Substitution> substitutions) { var clone = m_impl.Clone(); var pass = internal_add(substitutions); if (!pass) { m_impl = clone; } return(pass); }
public IActionResult OnPost() { var backupGrid = Grid.Clone(); var backupConstraints = Constraints.Clone(); PlantGrassOnZeroConstraints(Grid, Constraints); PlantGrassOnCellsWithNoAdjacentTree(Grid); UpdateProbability(Grid, Constraints); Grid = Solve(Grid, Constraints, 0); if (Grid == null) { Grid = backupGrid; Constraints = backupConstraints; } InitiateNumberList(); return(Page()); }