src/Misc/EFTools/EntityDesignModel/Commands/DeleteEntityTypeCommand.cs
/// <summary>
///     We override this method to do some specialized processing of AssociationEnd antiDeps
/// </summary>
/// <param name="cpc"></param>
We override this method to do some specialized processing of AssociationEnd antiDeps
We override this method to do some specialized processing of AssociationEnd antiDeps
protected override void RemoveAntiDeps(CommandProcessorContext cpc)
        {
            var associations = GetListOfAssociationsToBeDeleted(EntityType).ToArray();
            foreach (var association in associations)
            {
                var deleteAssociationCommand = association.GetDeleteCommand();
                DeleteInTransaction(cpc, deleteAssociationCommand);
            }
            if (EntityType.EntityModel.IsCSDL)
            {
                var cModel = EntityType.RuntimeModelRoot() as ConceptualEntityModel;
                if (cModel != null)
                {
                    foreach (var fi in EntityType.GetAntiDependenciesOfType<FunctionImport>())
                    {
                        CommandProcessor.InvokeSingleCommand(
                            cpc, new ChangeFunctionImportCommand(
                                cModel.FirstEntityContainer as ConceptualEntityContainer,
                                fi, fi.Function, fi.DisplayName, fi.IsComposable.Value, true,
                                Resources.NoneDisplayValueUsedForUX));
                    }
                }
            }
            base.RemoveAntiDeps(cpc);
        }
protected override void RemoveAntiDeps ( CommandProcessorContext cpc ) { var associations = GetListOfAssociationsToBeDeleted ( EntityType ) . ToArray ( ) ; foreach ( var association in associations ) { var deleteAssociationCommand = association . GetDeleteCommand ( ) ; DeleteInTransaction ( cpc , deleteAssociationCommand ) ; } if ( EntityType . EntityModel . IsCSDL ) { var cModel = EntityType . RuntimeModelRoot ( ) as ConceptualEntityModel ; if ( cModel != null ) { foreach ( var fi in EntityType . GetAntiDependenciesOfType < FunctionImport > ( ) ) { CommandProcessor . InvokeSingleCommand ( cpc , new ChangeFunctionImportCommand ( cModel . FirstEntityContainer as ConceptualEntityContainer , fi , fi . Function , fi . DisplayName , fi . IsComposable . Value , true , Resources . NoneDisplayValueUsedForUX ) ) ; } } } base . RemoveAntiDeps ( cpc ) ; }
We override this method to do some specialized processing of AssociationEnd antiDeps
We override this method to do some specialized processing of AssociationEnd antiDeps
// if this entity is used in an AssociationEnd, remove the entire Association // Note: have to convert to array first to prevent exceptions due to // editing the collection while iterating over it // If there is a FunctionImport which returns the entity type, set the FunctionImport return type to null. // process the remaining antiDeps normally
cpc
CommandProcessorContext
None