refactor(dir): ♻🚧 comment npgsql reload types throwing disposed exception

This commit is contained in:
Collin M. Barrett 2021-11-20 14:20:32 -06:00
parent 2fe9788b3c
commit bb6be61cc4

View file

@ -16,9 +16,11 @@ public static async Task MigrateAsync(this IHost host)
using var scope = host.Services.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<QueryDbContext>();
await db.Database.MigrateAsync();
await using var conn = (NpgsqlConnection)db.Database.GetDbConnection();
await conn.OpenAsync();
conn.ReloadTypes();
// TODO: sometimes throws System.ObjectDisposedException, but sometimes needed for https://www.npgsql.org/efcore/mapping/enum.html#creating-your-database-enum
//await using var conn = (NpgsqlConnection)db.Database.GetDbConnection();
//await conn.OpenAsync();
//conn.ReloadTypes();
}
}