src/Misc/EFTools/EntityDesignEntityDesigner/CustomCode/CustomSerializer/EntityModelToDslModelTranslatorStrategy.cs
/// <summary>
///     Translate model Property into view Property (creates a view Property if not yet created)
/// </summary>
/// <param name="viewEntityType"></param>
/// <param name="property"></param>
/// <returns></returns>
Translate model Property into view Property (creates a view Property if not yet created)
Translate model Property into view Property ( creates a view Property if not yet created )
private ViewModelProperty TranslateProperty(ViewModelEntityType viewEntityType, ModelProperty property)
        {
            var viewProperty =
                ModelToDesignerModelXRef.GetNewOrExisting(EditingContext, property, viewEntityType.Partition) as ViewModelProperty;
            var scalarProperty = viewProperty as ScalarProperty;
            if (scalarProperty != null)
            {
                scalarProperty.EntityKey = property.IsKeyProperty;
            }
            if (property.LocalName.Value != null)
            {
                viewProperty.Name = property.LocalName.Value;
            }
            viewProperty.Type = property.TypeName;
            return viewProperty;
        }
private ViewModelProperty TranslateProperty ( ViewModelEntityType viewEntityType , ModelProperty property ) { var viewProperty = ModelToDesignerModelXRef . GetNewOrExisting ( EditingContext , property , viewEntityType . Partition ) as ViewModelProperty ; var scalarProperty = viewProperty as ScalarProperty ; if ( scalarProperty != null ) { scalarProperty . EntityKey = property . IsKeyProperty ; } if ( property . LocalName . Value != null ) { viewProperty . Name = property . LocalName . Value ; } viewProperty . Type = property . TypeName ; return viewProperty ; }
Translate model Property into view Property (creates a view Property if not yet created)
Translate model Property into view Property ( creates a view Property if not yet created )
// flag if we are part of the key // set the other properties if they aren't null
None
viewEntityType
ViewModelEntityType
None
property
ModelProperty
None