Esempio n. 1
0
        /// <summary>
        ///     Call this method from the constructor of a class derived from <see cref="DbConfiguration" /> to set
        ///     an implementation of <see cref="IManifestTokenResolver" /> which allows provider manifest tokens to
        ///     be obtained from connections without necessarily opening the connection.
        /// </summary>
        /// <remarks>
        ///     This method is provided as a convenient and discoverable way to add configuration to the Entity Framework.
        ///     Internally it works in the same way as using AddDependencyResolver to add an appropriate resolver for
        ///     <see cref="IManifestTokenResolver" />. This means that, if desired, the same functionality can be achieved using
        ///     a custom resolver or a resolver backed by an Inversion-of-Control container.
        /// </remarks>
        /// <param name="resolver"> The manifest token resolver. </param>
        protected internal void ManifestTokenResolver(IManifestTokenResolver resolver)
        {
            Check.NotNull(resolver, "resolver");

            _internalConfiguration.CheckNotLocked("ManifestTokenResolver");
            _internalConfiguration.RegisterSingleton(resolver);
        }