fix(dir): 🐛🚑 ObjectDisposedException on startup migration

This commit is contained in:
Collin M. Barrett 2021-11-13 12:20:14 -06:00
parent 6d26e60a9f
commit f4a4c58ea2

View file

@ -9,11 +9,11 @@ namespace FilterLists.Directory.Infrastructure.Persistence;
public static class SeedExtension
{
public static Task MigrateAsync(this IHost host)
public static async Task MigrateAsync(this IHost host)
{
using var scope = host.Services.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<QueryDbContext>();
return db.Database.MigrateAsync();
await db.Database.MigrateAsync();
}
}