1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 15:20:48 -05:00

fix memory leak issue related to AddDbContext not working as expected

This commit is contained in:
RaidMax
2020-11-29 16:01:52 -06:00
parent 9ed3e50a63
commit 78ae9dec74
18 changed files with 499 additions and 505 deletions

View File

@ -13,7 +13,7 @@ namespace SharedLibraryCore.Database
{
public static async Task Seed(IDatabaseContextFactory contextFactory, CancellationToken token)
{
var context = contextFactory.CreateContext();
await using var context = contextFactory.CreateContext();
var strategy = context.Database.CreateExecutionStrategy();
await strategy.ExecuteAsync(async () =>
{

View File

@ -13,7 +13,7 @@ namespace SharedLibraryCore.Database.MigrationContext
}
}
public MySqlDatabaseContext(DbContextOptions<MySqlDatabaseContext> options) : base(options)
public MySqlDatabaseContext(DbContextOptions options) : base(options)
{
}

View File

@ -13,7 +13,7 @@ namespace SharedLibraryCore.Database.MigrationContext
}
}
public PostgresqlDatabaseContext(DbContextOptions<PostgresqlDatabaseContext> options) : base(options)
public PostgresqlDatabaseContext(DbContextOptions options) : base(options)
{
}

View File

@ -13,7 +13,7 @@ namespace SharedLibraryCore.Database.MigrationContext
}
}
public SqliteDatabaseContext(DbContextOptions<SqliteDatabaseContext> options) : base(options)
public SqliteDatabaseContext(DbContextOptions options) : base(options)
{
}