src/Misc/EFTools/EntityDesignEntityDesigner/CustomCode/DomainClasses/EntityDesignerViewModel.cs
/// <summary>
///     Updates corresponding view model item.
///     For simplicity each change updates all item values.
/// </summary>
Updates corresponding view model item.
For simplicity each change updates all item values.
Updates corresponding view model item . For simplicity each change updates all item values .
private void OnEFObjectUpdated(EfiChange change, ModelToDesignerModelXRefItem xref)
        {
            Debug.Assert(change.Changed != null);
            var efObject = change.Changed;
            var baseType = efObject as EntityTypeBaseType;
            if (baseType != null)
            {
                if (xref.ContainsKey(baseType.Parent))
                {
                    OnEFObjectDeleted(baseType, xref);
                    if (xref.ContainsKey(baseType.Parent))
                    {
                        ModelTranslatorContextItem.GetEntityModelTranslator(EditingContext).SynchronizeSingleDslModelElement(this, efObject);
                    }
                }
                return;
            }
            var associationEnd = efObject as AssociationEnd;
            if (associationEnd != null)
            {
                efObject = associationEnd.Parent;
            }
            OnEFObjectCreatedOrUpdated(efObject, xref);
        }
private void OnEFObjectUpdated ( EfiChange change , ModelToDesignerModelXRefItem xref ) { Debug . Assert ( change . Changed != null ) ; var efObject = change . Changed ; var baseType = efObject as EntityTypeBaseType ; if ( baseType != null ) { if ( xref . ContainsKey ( baseType . Parent ) ) { OnEFObjectDeleted ( baseType , xref ) ; if ( xref . ContainsKey ( baseType . Parent ) ) { ModelTranslatorContextItem . GetEntityModelTranslator ( EditingContext ) . SynchronizeSingleDslModelElement ( this , efObject ) ; } } return ; } var associationEnd = efObject as AssociationEnd ; if ( associationEnd != null ) { efObject = associationEnd . Parent ; } OnEFObjectCreatedOrUpdated ( efObject , xref ) ; }
Updates corresponding view model item.
Updates corresponding view model item .
// Updating a base type is a special case, because it really means creating or deleting an inheritance connector // always recreate inheritance // for AssociationEnd we want to update parent Association // regardless the change always update whole element (it shouldn't be too big overhead)
change
EfiChange
xref
ModelToDesignerModelXRefItem