private static List<V104.ParentAssociationData> AdaptImplementsAssociations(dynamic oldSubject) { var implementsList = new List<V104.ParentAssociationData>(); foreach (dynamic implements in oldSubject.Implements) { var implements104 = new V104.ParentAssociationData { Name = implements.Name, Show = implements.Show, AssociatedTo = AdaptVisualisedType(implements.AssociatedTo) }; implementsList.Add(implements104); } return implementsList; }
private static V104.VisualisableTypeSubjectData AdaptVisualisedSubject(dynamic oldSubject) { // subjust should be of type VisualisableTypeSubjectData (either v101 or v102) var subject104 = new V104.VisualisableTypeSubjectData { SubjectOrAssociate = SubjectOrAssociate.Subject }; CopyBaseVisualisedType(oldSubject, subject104); // Associations dynamic associationList = AdaptAssociations(oldSubject); subject104.Associations = associationList.ToArray(); // Implements dynamic implementsList = AdaptImplementsAssociations(oldSubject); subject104.Implements = implementsList.ToArray(); // Parent if (oldSubject.Parent != null) { var parent104 = new V104.ParentAssociationData { Name = oldSubject.Parent.Name, Show = oldSubject.Parent.Show, AssociatedTo = AdaptVisualisedType(oldSubject.Parent.AssociatedTo) }; subject104.Parent = parent104; } return subject104; }