Exemple #1
0
        internal static CreateFunctionCommand GetCreateFunctionCommandFromDataSchemaProcedure(
            IRawDataSchemaProcedure procedure, EFArtifact artifact, Func <Command, CommandProcessorContext, bool> bindingAction = null)
        {
            CreateFunctionCommand createFunctionCommand = null;

            if (procedure.IsFunction)
            {
                createFunctionCommand = new CreateFunctionCommand
                                        (
                    name: ModelHelper.CreateValidSimpleIdentifier(procedure.Name),
                    schemaName: procedure.Schema,
                    isNiladic: !procedure.RawParameters.Any(),
                    isAggregate: false, // figure out if there's some way to determine this from IDataSchemaProcedure
                    isBuiltIn: false,
                    isComposable: true, // figure out if there's some way to determine this from IDataSchemaProcedure
                    commandText: null,
                    returnType: GetReturnType(procedure, artifact),
                    storeFunctionName: procedure.Name,
                    parameterInfos: GetParameterInfos(procedure, artifact),
                    dataSchemaProcedure: procedure,
                    bindingAction: bindingAction
                                        );
            }
            else
            {
                createFunctionCommand = new CreateFunctionCommand
                                        (
                    name: ModelHelper.CreateValidSimpleIdentifier(procedure.Name),
                    storeFunctionName: procedure.Name,
                    schemaName: procedure.Schema,
                    commandText: null,
                    parameterInfos: GetParameterInfos(procedure, artifact),
                    dataSchemaProcedure: procedure,
                    bindingAction: bindingAction
                                        );
            }

            return(createFunctionCommand);
        }
        internal static CreateFunctionCommand GetCreateFunctionCommandFromDataSchemaProcedure(
            IRawDataSchemaProcedure procedure, EFArtifact artifact, Func<Command, CommandProcessorContext, bool> bindingAction = null)
        {
            CreateFunctionCommand createFunctionCommand = null;
            if (procedure.IsFunction)
            {
                createFunctionCommand = new CreateFunctionCommand
                    (
                    name: ModelHelper.CreateValidSimpleIdentifier(procedure.Name),
                    schemaName: procedure.Schema,
                    isNiladic: !procedure.RawParameters.Any(),
                    isAggregate: false, // figure out if there's some way to determine this from IDataSchemaProcedure
                    isBuiltIn: false,
                    isComposable: true, // figure out if there's some way to determine this from IDataSchemaProcedure
                    commandText: null,
                    returnType: GetReturnType(procedure, artifact),
                    storeFunctionName: procedure.Name,
                    parameterInfos: GetParameterInfos(procedure, artifact),
                    dataSchemaProcedure: procedure,
                    bindingAction: bindingAction
                    );
            }
            else
            {
                createFunctionCommand = new CreateFunctionCommand
                    (
                    name: ModelHelper.CreateValidSimpleIdentifier(procedure.Name),
                    storeFunctionName: procedure.Name,
                    schemaName: procedure.Schema,
                    commandText: null,
                    parameterInfos: GetParameterInfos(procedure, artifact),
                    dataSchemaProcedure: procedure,
                    bindingAction: bindingAction
                    );
            }

            return createFunctionCommand;
        }