src/Misc/EFTools/EntityDesignEntityDesigner/CustomCode/CustomSerializer/EntityModelToDslModelTranslatorStrategy.cs
/// <summary>
///     Translate base type of a model EntityType into view Inheritance (creates an Inheritance if not yet created)
/// </summary>
/// <param name="viewModel"></param>
/// <param name="entityType"></param>
/// <returns></returns>
Translate base type of a model EntityType into view Inheritance (creates an Inheritance if not yet created)
Translate base type of a model EntityType into view Inheritance ( creates an Inheritance if not yet created )
private static Inheritance TranslateBaseType(EntityDesignerViewModel viewModel, ConceptualEntityType entityType)
        {
            if (entityType.BaseType.Status == BindingStatus.Known)
            {
                var baseType =
                    ModelToDesignerModelXRef.GetExisting(viewModel.EditingContext, entityType.BaseType.Target, viewModel.Partition) as
                    ViewModelEntityType;
                var derivedType =
                    ModelToDesignerModelXRef.GetExisting(viewModel.EditingContext, entityType, viewModel.Partition) as ViewModelEntityType;
                if (baseType != null
                    && derivedType != null)
                {
                    return
                        ModelToDesignerModelXRef.GetNewOrExisting(viewModel.EditingContext, entityType.BaseType, baseType, derivedType) as
                        Inheritance;
                }
            }
            return null;
        }
private static Inheritance TranslateBaseType ( EntityDesignerViewModel viewModel , ConceptualEntityType entityType ) { if ( entityType . BaseType . Status == BindingStatus . Known ) { var baseType = ModelToDesignerModelXRef . GetExisting ( viewModel . EditingContext , entityType . BaseType . Target , viewModel . Partition ) as ViewModelEntityType ; var derivedType = ModelToDesignerModelXRef . GetExisting ( viewModel . EditingContext , entityType , viewModel . Partition ) as ViewModelEntityType ; if ( baseType != null && derivedType != null ) { return ModelToDesignerModelXRef . GetNewOrExisting ( viewModel . EditingContext , entityType . BaseType , baseType , derivedType ) as Inheritance ; } } return null ; }
Translate base type of a model EntityType into view Inheritance (creates an Inheritance if not yet created)
Translate base type of a model EntityType into view Inheritance ( creates an Inheritance if not yet created )
// in Multiple diagram scenario, baseType and derivedType might not exist in the diagram.
None
viewModel
EntityDesignerViewModel
None
entityType
ConceptualEntityType
None