Esempio n. 1
0
        /// <summary>
        /// Gets the function as specified by the function key.
        /// All parameters are assumed to be <see cref="ParameterMode.In"/>.
        /// </summary>
        /// <param name="functionName">Name of the function</param>
        /// <param name="parameterTypes">types of the parameters</param>
        /// <param name="ignoreCase">true for case-insensitive lookup</param>
        /// <param name="function">The function that needs to be returned</param>
        /// <returns> The function as specified in the function key or null</returns>
        /// <exception cref="System.ArgumentNullException">if functionName or parameterTypes argument is null</exception>
        /// <exception cref="System.ArgumentException">if no function is found with the given name or with given input parameters</exception>
        internal bool TryGetFunction(string functionName, TypeUsage[] parameterTypes, bool ignoreCase, out EdmFunction function)
        {
            EntityUtil.GenericCheckArgumentNull(functionName, "functionName");
            EntityUtil.GenericCheckArgumentNull(parameterTypes, "parameterTypes");
            string     functionIdentity = EdmFunction.BuildIdentity(functionName, parameterTypes);
            GlobalItem item             = null;

            function = null;
            if (TryGetValue(functionIdentity, ignoreCase, out item) && Helper.IsEdmFunction(item))
            {
                function = (EdmFunction)item;
                return(true);
            }
            return(false);
        }