Esempio n. 1
0
        /// <summary>
        /// Registers the Entity Framework 6.x stores services in the DI container and
        /// configures OpenIddict to use the Entity Framework 6.x entities by default.
        /// </summary>
        /// <param name="builder">The services builder used by OpenIddict to register new services.</param>
        /// <param name="configuration">The configuration delegate used to configure the Entity Framework 6.x services.</param>
        /// <remarks>This extension can be safely called multiple times.</remarks>
        /// <returns>The <see cref="OpenIddictCoreBuilder"/>.</returns>
        public static OpenIddictCoreBuilder UseEntityFramework(
            this OpenIddictCoreBuilder builder, Action <OpenIddictEntityFrameworkBuilder> configuration)
        {
            if (builder is null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            if (configuration is null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }

            configuration(builder.UseEntityFramework());

            return(builder);
        }