public void Adopt(RelationSet relationSet) { Name = relationSet.Name; CreateDate = relationSet.CreateDate; ModifyDate = relationSet.ModifyDate; Relations.Clear(); foreach (Relation relation in relationSet.Relations) { Relations.Add(relation.Clone()); } Databases.Clear(); foreach (string database in relationSet.Databases) { Databases.Add(database); } }
public RelationSet Clone() { RelationSet relationSet = new RelationSet() { Name = Name, CreateDate = CreateDate, ModifyDate = ModifyDate }; foreach (Relation relation in Relations) { relationSet.Relations.Add(relation.Clone()); } foreach (string database in Databases) { relationSet.Databases.Add(database); } return(relationSet); }