src/Misc/EFTools/EntityDesign/UI/ViewModels/MappingDetails/FunctionImport/MappingFunctionImport.cs
// <summary>
//     Changes the s-side Function in the FunctionImportMapping
// </summary>
Changes the s-side Function in the FunctionImportMapping
Changes the s - side Function in the FunctionImportMapping
internal void ChangeModelItem(EditingContext context, Function newFunction)
        {
            var fi = FunctionImportMapping.FunctionImportName.Target;
            if (fi != null
                && FunctionImportMapping.FunctionName.Target != newFunction)
            {
                var cModel = EFExtensions.RuntimeModelRoot(FunctionImportMapping.FunctionImportName.Target) as ConceptualEntityModel;
                if (cModel != null)
                {
                    var cmd = new ChangeFunctionImportCommand(
                        cModel.FirstEntityContainer as ConceptualEntityContainer,
                        fi,
                        newFunction,
                        fi.LocalName.Value,
                        fi.IsComposable.Value,
                        false,
                        null);
                    var cpc = new CommandProcessorContext(
                        context, EfiTransactionOriginator.MappingDetailsOriginatorId, Resources.Tx_ChangeFuncImpMapping);
                    VsUtils.EnsureProvider(cpc.Artifact);
                    CommandProcessor.InvokeSingleCommand(cpc, cmd);
                }
            }
        }
internal void ChangeModelItem ( EditingContext context , Function newFunction ) { var fi = FunctionImportMapping . FunctionImportName . Target ; if ( fi != null && FunctionImportMapping . FunctionName . Target != newFunction ) { var cModel = EFExtensions . RuntimeModelRoot ( FunctionImportMapping . FunctionImportName . Target ) as ConceptualEntityModel ; if ( cModel != null ) { var cmd = new ChangeFunctionImportCommand ( cModel . FirstEntityContainer as ConceptualEntityContainer , fi , newFunction , fi . LocalName . Value , fi . IsComposable . Value , false , null ) ; var cpc = new CommandProcessorContext ( context , EfiTransactionOriginator . MappingDetailsOriginatorId , Resources . Tx_ChangeFuncImpMapping ) ; VsUtils . EnsureProvider ( cpc . Artifact ) ; CommandProcessor . InvokeSingleCommand ( cpc , cmd ) ; } } }
Changes the s-side Function in the FunctionImportMapping
Changes the s - side Function in the FunctionImportMapping
// This command can be called before the provider has been registered with the  // resolver (e.g. Mapping Details window on a newly-opened project) - so ensure // provider is registered here before any commands are invoked
context
EditingContext
newFunction
Function