/// <summary>
        /// Adds an entity container element to this entity container.
        /// </summary>
        /// <param name="element">The element to add.</param>
        public void AddElement(IEdmEntityContainerElement element)
        {
            EdmUtil.CheckArgumentNull(element, "element");

            this.containerElements.Add(element);

            switch (element.ContainerElementKind)
            {
            case EdmContainerElementKind.EntitySet:
                RegistrationHelper.AddElement((IEdmEntitySet)element, element.Name, this.entitySetDictionary, RegistrationHelper.CreateAmbiguousEntitySetBinding);
                break;

            case EdmContainerElementKind.Singleton:
                RegistrationHelper.AddElement((IEdmSingleton)element, element.Name, this.singletonDictionary, RegistrationHelper.CreateAmbiguousSingletonBinding);
                break;

            case EdmContainerElementKind.ActionImport:
            case EdmContainerElementKind.FunctionImport:
                RegistrationHelper.AddOperationImport((IEdmOperationImport)element, element.Name, this.operationImportDictionary);
                break;

            case EdmContainerElementKind.None:
                throw new InvalidOperationException(Edm.Strings.EdmEntityContainer_CannotUseElementWithTypeNone);

            default:
                throw new InvalidOperationException(Edm.Strings.UnknownEnumVal_ContainerElementKind(element.ContainerElementKind));
            }
        }
        private Dictionary <string, object> ComputeOperationImportsDictionary()
        {
            Dictionary <string, object> operationImports = new Dictionary <string, object>();

            foreach (IEdmOperationImport operationImport in this.Elements.OfType <IEdmOperationImport>())
            {
                RegistrationHelper.AddOperationImport(operationImport, operationImport.Name, operationImports);
            }

            return(operationImports);
        }