Initial commit
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace RobotNet10.NavigationTune.Data;
|
||||
|
||||
public static class TuningDbExtensions
|
||||
{
|
||||
extension (IServiceProvider serviceProvider)
|
||||
{
|
||||
public async Task SeedTuningDbAsync()
|
||||
{
|
||||
using var scope = serviceProvider.CreateScope();
|
||||
|
||||
using var appDb = scope.ServiceProvider.GetRequiredService<TuningDbContext>();
|
||||
|
||||
await appDb.Database.MigrateAsync();
|
||||
await appDb.Database.EnsureCreatedAsync();
|
||||
await appDb.SaveChangesAsync();
|
||||
await DefaultDataSeeder.SeedAsync(appDb);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user