EFIngresProvider/SqlGen/Functions/FunctionHandler.cs
/// <summary>
/// Default handling on function arguments
/// Appends the list of arguments to the given result
/// If the function is niladic it does not append anything,
/// otherwise it appends (arg1, arg2, ..., argn)
/// </summary>
/// <param name="e"></param>
/// <param name="result"></param>
Default handling on function arguments
Appends the list of arguments to the given result
If the function is niladic it does not append anything,
otherwise it appends (arg1, arg2, ..., argn)
Default handling on function arguments Appends the list of arguments to the given result If the function is niladic it does not append anything otherwise it appends ( arg1 arg2 ... argn )
protected void HandleFunctionArgumentsDefault(SqlGenerator sqlGenerator, DbFunctionExpression e, SqlBuilder result)
        {
            var isNiladicFunction = MetadataHelpers.TryGetValueForMetadataProperty<bool>(e.Function, "NiladicFunctionAttribute");
            if (isNiladicFunction && e.Arguments.Count > 0)
            {
                throw new InvalidOperationException("Niladic functions cannot have parameters");
            }
            if (!isNiladicFunction)
            {
                result.Append("(");
                var separator = "";
                foreach (var arg in e.Arguments)
                {
                    result.Append(separator, arg.Accept(sqlGenerator));
                    separator = ", ";
                }
                result.Append(")");
            }
        }
protected void HandleFunctionArgumentsDefault ( SqlGenerator sqlGenerator , DbFunctionExpression e , SqlBuilder result ) { var isNiladicFunction = MetadataHelpers . TryGetValueForMetadataProperty < bool > ( e . Function , " " ) ; if ( isNiladicFunction && e . Arguments . Count > 0 ) { throw new InvalidOperationException ( " " ) ; } if ( ! isNiladicFunction ) { result . Append ( " " ) ; var separator = " " ; foreach ( var arg in e . Arguments ) { result . Append ( separator , arg . Accept ( sqlGenerator ) ) ; separator = " " ; } result . Append ( " " ) ; } }
Default handling on function arguments
Appends the list of arguments to the given result
If the function is niladic it does not append anything,
otherwise it appends (arg1, arg2, ..., argn)
Default handling on function arguments Appends the list of arguments to the given result If the function is niladic it does not append anything otherwise it appends ( arg1 arg2 ... argn )
sqlGenerator
SqlGenerator
e
DbFunctionExpression
None
result
SqlBuilder
None