src/Misc/EFTools/EntityDesign/UI/ViewModels/MappingDetails/Table/MappingStorageEntityType.cs
// <summary>
//     NOTE: We don't call this.Parent.RemoveChild(this) because this is always called from the MappingEFElement.Delete() method
//     which will remove this item from the parent.
// </summary>
We don't call this.Parent.RemoveChild(this) because this is always called from the MappingEFElement.Delete() method
which will remove this item from the parent.
We don ' t call this . Parent . RemoveChild ( this ) because this is always called from the MappingEFElement . Delete () method which will remove this item from the parent .
internal override void DeleteModelItem(CommandProcessorContext cpc)
        {
            Debug.Assert(ModelItem != null, "We are trying to delete a null ModelItem");
            if (IsModelItemDeleted() == false)
            {
                if (cpc == null)
                {
                    cpc = new CommandProcessorContext(
                        Context, EfiTransactionOriginator.MappingDetailsOriginatorId, Resources.Tx_DeleteMappingFragment);
                }
                var fragment = ModelHelper.FindMappingFragment(
                    cpc, MappingConceptualEntityType.ConceptualEntityType, StorageEntityType, false);
                Debug.Assert(fragment != null, "could not find MappingFragment for StorageEntityType " + StorageEntityType.ToPrettyString());
                if (fragment != null)
                {
                    var deleteCommand = fragment.GetDeleteCommand();
                    deleteCommand.PostInvokeEvent += (o, eventsArgs) =>
                        {
                            ModelItem = null;
                            ColumnMappings.ModelItem = null;
                        };
                    DeleteEFElementCommand.DeleteInTransaction(cpc, deleteCommand);
                }
            }
            ModelItem = null;
            ColumnMappings.ModelItem = null;
        }
internal override void DeleteModelItem ( CommandProcessorContext cpc ) { Debug . Assert ( ModelItem != null , " " ) ; if ( IsModelItemDeleted ( ) == false ) { if ( cpc == null ) { cpc = new CommandProcessorContext ( Context , EfiTransactionOriginator . MappingDetailsOriginatorId , Resources . Tx_DeleteMappingFragment ) ; } var fragment = ModelHelper . FindMappingFragment ( cpc , MappingConceptualEntityType . ConceptualEntityType , StorageEntityType , false ) ; Debug . Assert ( fragment != null , " " + StorageEntityType . ToPrettyString ( ) ) ; if ( fragment != null ) { var deleteCommand = fragment . GetDeleteCommand ( ) ; deleteCommand . PostInvokeEvent += ( o , eventsArgs ) => { ModelItem = null ; ColumnMappings . ModelItem = null ; } ; DeleteEFElementCommand . DeleteInTransaction ( cpc , deleteCommand ) ; } } ModelItem = null ; ColumnMappings . ModelItem = null ; }
NOTE: We don't call this.Parent.RemoveChild(this) because this is always called from the MappingEFElement.Delete() method
which will remove this item from the parent.
NOTE : We don ' t call this . Parent . RemoveChild ( this ) because this is always called from the MappingEFElement . Delete () method which will remove this item from the parent .
// create a context if we weren't passed one // use the item's delete command // if IsModelItemDeleted == true, just make sure that it is null anyways
cpc
CommandProcessorContext