using Microsoft.EntityFrameworkCore; namespace RobotNet.RobotManager.Data; public static class RobotManagerDbExtensions { public static async Task SeedRobotManagerDbAsync(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(); } }