23 lines
743 B
C#
23 lines
743 B
C#
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<IServiceScopeFactory>();
|
|
using (var scope = scopeFactory.CreateScope())
|
|
{
|
|
var identityDbInitialize = scope.ServiceProvider.GetService<IDbService>();
|
|
identityDbInitialize.Initialize();
|
|
}
|
|
}
|
|
}
|
|
}
|