Esempio n. 1
0
 /// <summary>Returns all the overloads of the functions by using the specified name from this item collection.</summary>
 /// <returns>
 /// A collection of type <see cref="T:System.Collections.ObjectModel.ReadOnlyCollection`1" /> that contains all the functions that have the specified name.
 /// </returns>
 /// <param name="functionName">The full name of the function.</param>
 /// <param name="ignoreCase">true to perform the case-insensitive search; otherwise, false.</param>
 public ReadOnlyCollection <EdmFunction> GetFunctions(
     string functionName,
     bool ignoreCase)
 {
     return(ItemCollection.GetFunctions(this.FunctionLookUpTable, functionName, ignoreCase));
 }
Esempio n. 2
0
        internal bool TryGetFunctionByName(
            string namespaceName,
            string functionName,
            bool ignoreCase,
            out IList <EdmFunction> functionOverloads)
        {
            Check.NotEmpty(namespaceName, nameof(namespaceName));
            Check.NotEmpty(functionName, nameof(functionName));
            string              functionName1   = namespaceName + "." + functionName;
            ItemCollection      itemCollection  = this._metadataWorkspace.GetItemCollection(this._targetDataspace);
            IList <EdmFunction> edmFunctionList = this._targetDataspace == DataSpace.SSpace ? (IList <EdmFunction>)((StoreItemCollection)itemCollection).GetCTypeFunctions(functionName1, ignoreCase) : (IList <EdmFunction>)itemCollection.GetFunctions(functionName1, ignoreCase);

            if (this._targetDataspace == DataSpace.CSpace)
            {
                EntityContainer entityContainer;
                EdmFunction     functionImport;
                if ((edmFunctionList == null || edmFunctionList.Count == 0) && (this.TryGetEntityContainer(namespaceName, false, out entityContainer) && this.TryGetFunctionImport(entityContainer, functionName, false, out functionImport)))
                {
                    edmFunctionList = (IList <EdmFunction>) new EdmFunction[1]
                    {
                        functionImport
                    }
                }
                ;
                ItemCollection collection;
                if ((edmFunctionList == null || edmFunctionList.Count == 0) && this._metadataWorkspace.TryGetItemCollection(DataSpace.SSpace, out collection))
                {
                    edmFunctionList = (IList <EdmFunction>)((StoreItemCollection)collection).GetCTypeFunctions(functionName1, ignoreCase);
                }
            }
            functionOverloads = edmFunctionList == null || edmFunctionList.Count <= 0 ? (IList <EdmFunction>)null : edmFunctionList;
            return(functionOverloads != null);
        }