Esempio n. 1
0
        private static Dictionary <string, ReadOnlyCollection <EdmFunction> > PopulateFunctionLookUpTable(ItemCollection itemCollection)
        {
            var tempFunctionLookUpTable = new Dictionary <string, List <EdmFunction> >(StringComparer.OrdinalIgnoreCase);

            foreach (var function in itemCollection.GetItems <EdmFunction>())
            {
                List <EdmFunction> functionList;
                if (!tempFunctionLookUpTable.TryGetValue(function.FullName, out functionList))
                {
                    functionList = new List <EdmFunction>();
                    tempFunctionLookUpTable[function.FullName] = functionList;
                }
                functionList.Add(function);
            }

            var functionLookUpTable = new Dictionary <string, ReadOnlyCollection <EdmFunction> >(StringComparer.OrdinalIgnoreCase);

            foreach (var functionList in tempFunctionLookUpTable.Values)
            {
                functionLookUpTable.Add(functionList[0].FullName, new ReadOnlyCollection <EdmFunction>(functionList.ToArray()));
            }

            return(functionLookUpTable);
        }
Esempio n. 2
0
 /// <summary>
 ///     Determines whether this item collection is equivalent to another. At present, we look only
 ///     at object reference equivalence. This is a somewhat reasonable approximation when caching
 ///     is enabled, because collections are identical when their source resources (including
 ///     provider) are known to be identical.
 /// </summary>
 /// <param name="other"> Collection to compare. </param>
 /// <returns> true if the collections are equivalent; false otherwise </returns>
 internal virtual bool MetadataEquals(ItemCollection other)
 {
     return(ReferenceEquals(this, other));
 }