using Microsoft.EntityFrameworkCore; namespace RobotNet.MapManager.Data; public static class MapManagerDbExtensions { public static async Task SeedMapManagerDbAsync(this IServiceProvider serviceProvider) { using var scope = serviceProvider.GetRequiredService().CreateScope(); using var appDb = scope.ServiceProvider.GetRequiredService(); await appDb.Database.MigrateAsync(); //await appDb.Database.EnsureCreatedAsync(); await appDb.SaveChangesAsync(); } }