mirror of
https://github.com/fergalmoran/deepsouthsounds.git
synced 2025-12-22 09:52:27 +00:00
24 lines
821 B
C#
24 lines
821 B
C#
using DSS.Api.Data;
|
|
using Microsoft.AspNetCore.Builder;
|
|
using Microsoft.AspNetCore.Identity;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.Extensions.Configuration;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
namespace DSS.Api.Services.Startup {
|
|
internal static class DbMigratorExtensions {
|
|
internal static void UpdateDatabase(
|
|
this IApplicationBuilder app,
|
|
IConfiguration config) {
|
|
|
|
using var serviceScope = app.ApplicationServices
|
|
.GetRequiredService<IServiceScopeFactory>()
|
|
.CreateScope();
|
|
|
|
using var context = serviceScope.ServiceProvider.GetService<DSSDbContext>();
|
|
context.Database.Migrate();
|
|
// DSSDbContextInitialiser.SeedUsers(userManager, context, config);
|
|
}
|
|
}
|
|
}
|