CreateCanonicalFunction() private method

Creates a canonical function with the given name and the given arguments
private CreateCanonicalFunction ( string functionName, Expression Expression ) : DbFunctionExpression
functionName string Should represent a non-aggregate canonical function
Expression System.Linq.Expressions.Expression Passed only for error handling purposes
return DbFunctionExpression
            internal static CqtExpression ConcatArgs(ExpressionConverter parent, Expression linq, Expression[] linqArgs)
            {
                var args = linqArgs
                        .Where(arg => !arg.IsNullConstant()) // remove null constants   
                        .Select(arg => ConvertToString(parent, arg)) // Apply ToString semantics                    
                        .ToArray();

                //if all args was null constants, optimize the entire expression to constant "" 
                // e.g null + null + null == ""
                if (args.Length == 0)
                {
                    return DbExpressionBuilder.Constant(string.Empty);
                }

                var current = args.First();
                foreach (var next in args.Skip(1)) //concat all args
                {
                    current = parent.CreateCanonicalFunction(Concat, linq, current, next);
                }

                return current;
            }