private static LinqBuiltInFunction CreateFunction(string className, string clrMethodOrPropertyName, string protocolFunctionName, DataType returnType, LinqBuiltInFunctionKind kind)
        {
            var function = new LinqBuiltInFunction(className, clrMethodOrPropertyName, new QueryBuiltInFunction(className, clrMethodOrPropertyName, returnType), kind);

            function.Annotations.Add(new ODataCanonicalFunctionNameAnnotation()
            {
                Name = protocolFunctionName
            });
            return(function);
        }
示例#2
0
 /// <summary>
 /// Initializes a new instance of the LinqBuiltInFunctionCallExpression class.
 /// </summary>
 /// <param name="resultType">The result type.</param>
 /// <param name="linqBuiltInFunction">The built-in function.</param>
 /// <param name="arguments">The arguments for the function call.</param>
 internal LinqBuiltInFunctionCallExpression(QueryType resultType, LinqBuiltInFunction linqBuiltInFunction, params QueryExpression[] arguments)
     : base(resultType)
 {
     this.Arguments           = new ReadOnlyCollection <QueryExpression>(arguments.ToList());
     this.LinqBuiltInFunction = linqBuiltInFunction;
 }