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