using System; using System.Collections.Generic; using System.Text; using iPackage.Core.Web.Services.Contracts; using Microsoft.AspNetCore.Builder; using Microsoft.Extensions.DependencyInjection; namespace iPackage.Core.Web.WebFramework.Configurations { public static class AppConfigExtensions { public static async void UseDbInitializer(this IApplicationBuilder app) { var scopeFactory = app.ApplicationServices.GetRequiredService(); using (var scope = scopeFactory.CreateScope()) { var identityDbInitialize = scope.ServiceProvider.GetService(); identityDbInitialize.Initialize(); } } } }