/// <summary> /// Checks that all arguments are SingleValueNodes /// </summary> /// <param name="functionName">The name of the function the arguments are from.</param> /// <param name="argumentNodes">The arguments to validate.</param> /// <returns>SingleValueNode array</returns> internal static SingleValueNode[] ValidateArgumentsAreSingleValue(string functionName, List <QueryNode> argumentNodes) { ExceptionUtils.CheckArgumentNotNull(functionName, "functionCallToken"); ExceptionUtils.CheckArgumentNotNull(argumentNodes, "argumentNodes"); // Right now all functions take a single value for all arguments SingleValueNode[] ret = new SingleValueNode[argumentNodes.Count]; for (int i = 0; i < argumentNodes.Count; i++) { SingleValueNode argumentNode = argumentNodes[i] as SingleValueNode; if (argumentNode == null) { throw new ODataException(ODataErrorStrings.MetadataBinder_FunctionArgumentNotSingleValue(functionName)); } ret[i] = argumentNode; } return(ret); }