private static ModelElement CreateModelElementForEFObjectType(EFObject obj, Partition partition) { ModelElement modelElement = null; var t = obj.GetType(); if (t == typeof(ConceptualEntityModel)) { modelElement = new EntityDesignerViewModel(partition); } else if (t == typeof(ConceptualEntityType)) { modelElement = new EntityType(partition); } else if (t == typeof(ConceptualProperty)) { modelElement = new ScalarProperty(partition); } else if (t == typeof(ComplexConceptualProperty)) { modelElement = new ComplexProperty(partition); } else if (t == typeof(Association)) { modelElement = new ViewModel.Association(partition); } else if (t == typeof(EntityTypeBaseType)) { modelElement = new Inheritance(partition); } else if (t == typeof(NavigationProperty)) { modelElement = new ViewModel.NavigationProperty(partition); } return modelElement; }
internal static ModelElement CreateConnectorModelElementForEFObjectType(EFObject obj, ModelElement end1, ModelElement end2) { ModelElement modelElement = null; var t = obj.GetType(); var et1 = end1 as EntityType; var et2 = end2 as EntityType; if (t == typeof(Association)) { Debug.Assert(et1 != null && et2 != null, "Unexpected end type for Association model element"); modelElement = new ViewModel.Association(et1, et2); } else if (t == typeof(EntityTypeBaseType)) { Debug.Assert(et1 != null && et2 != null, "Unexpected end type for Inheritance model element"); modelElement = new Inheritance(et1, et2); } return modelElement; }
internal static ModelElement CreateConnectorModelElementForEFObjectType(EFObject obj, ModelElement end1, ModelElement end2) { ModelElement modelElement = null; var t = obj.GetType(); var et1 = end1 as EntityType; var et2 = end2 as EntityType; if (t == typeof(Association)) { Debug.Assert(et1 != null && et2 != null, "Unexpected end type for Association model element"); modelElement = new ViewModel.Association(et1, et2); } else if (t == typeof(EntityTypeBaseType)) { Debug.Assert(et1 != null && et2 != null, "Unexpected end type for Inheritance model element"); modelElement = new Inheritance(et1, et2); } return(modelElement); }
private static ModelElement CreateModelElementForEFObjectType(EFObject obj, Partition partition) { ModelElement modelElement = null; var t = obj.GetType(); if (t == typeof(ConceptualEntityModel)) { modelElement = new EntityDesignerViewModel(partition); } else if (t == typeof(ConceptualEntityType)) { modelElement = new EntityType(partition); } else if (t == typeof(ConceptualProperty)) { modelElement = new ScalarProperty(partition); } else if (t == typeof(ComplexConceptualProperty)) { modelElement = new ComplexProperty(partition); } else if (t == typeof(Association)) { modelElement = new ViewModel.Association(partition); } else if (t == typeof(EntityTypeBaseType)) { modelElement = new Inheritance(partition); } else if (t == typeof(NavigationProperty)) { modelElement = new ViewModel.NavigationProperty(partition); } return(modelElement); }