Beispiel #1
0
        /// <summary>
        ///     Returns an <see cref="T:System.Data.Entity.Core.Metadata.Edm.EntityContainer" /> object by using the specified entity container name. If there is no entity container, this output parameter contains null; otherwise, it contains the first entity container.
        /// </summary>
        /// <returns>true if there is an entity container that matches the search criteria; otherwise, false.</returns>
        /// <param name="name">The name of the entity container.</param>
        /// <param name="ignoreCase">true to perform the case-insensitive search; otherwise, false.</param>
        /// <param name="entityContainer">
        ///     When this method returns, it contains an <see cref="T:System.Data.Entity.Core.Metadata.Edm.EntityContainer" /> object. If there is no entity container, this output parameter contains null; otherwise, it contains the first entity container.
        /// </param>
        public bool TryGetEntityContainer(string name, bool ignoreCase, out EntityContainer entityContainer)
        {
            Check.NotNull(name, "name");
            GlobalItem item = null;

            if (TryGetValue(name, ignoreCase, out item) &&
                Helper.IsEntityContainer(item))
            {
                entityContainer = (EntityContainer)item;
                return(true);
            }
            entityContainer = null;
            return(false);
        }
Beispiel #2
0
        /// <summary>
        /// Returns an <see cref="T:System.Data.Entity.Core.Metadata.Edm.EntityContainer" /> object by using the specified entity container name. If there is no entity container, this output parameter contains null; otherwise, it contains the first entity container.
        /// </summary>
        /// <returns>true if there is an entity container that matches the search criteria; otherwise, false.</returns>
        /// <param name="name">The name of the entity container.</param>
        /// <param name="ignoreCase">true to perform the case-insensitive search; otherwise, false.</param>
        /// <param name="entityContainer">
        /// When this method returns, it contains an <see cref="T:System.Data.Entity.Core.Metadata.Edm.EntityContainer" /> object. If there is no entity container, this output parameter contains null; otherwise, it contains the first entity container.
        /// </param>
        public bool TryGetEntityContainer(
            string name,
            bool ignoreCase,
            out EntityContainer entityContainer)
        {
            Check.NotNull <string>(name, nameof(name));
            GlobalItem globalItem = (GlobalItem)null;

            if (this.TryGetValue(name, ignoreCase, out globalItem) && Helper.IsEntityContainer(globalItem))
            {
                entityContainer = (EntityContainer)globalItem;
                return(true);
            }
            entityContainer = (EntityContainer)null;
            return(false);
        }