Example #1
0
        /// <summary>
        /// Gets the list of operations that are always bindable to a type.
        /// </summary>
        /// <param name="bindingType">The binding type in question.</param>
        /// <returns>The list of operations that are always bindable to a type.</returns>
        public IEdmFunctionImport[] GetAlwaysBindableOperationsForType(IEdmType bindingType)
        {
            Debug.Assert(bindingType != null, "bindingType != null");
            Debug.Assert(this.alwaysBindableOperationsCache != null, "this.alwaysBindableOperationsCache != null");
            Debug.Assert(this.isResponse, "this.readingResponse");

            IEdmFunctionImport[] alwaysBindableOperations;
            if (!this.alwaysBindableOperationsCache.TryGetValue(bindingType, out alwaysBindableOperations))
            {
                alwaysBindableOperations = MetadataUtils.CalculateAlwaysBindableOperationsForType(bindingType, this.model, this.edmTypeResolver);
                this.alwaysBindableOperationsCache.Add(bindingType, alwaysBindableOperations);
            }

            return(alwaysBindableOperations);
        }