Minor code updates

This commit is contained in:
Jordan Brown
2020-05-10 21:26:15 -04:00
parent d70f99cc0a
commit 72395d664d
3 changed files with 27 additions and 33 deletions
@@ -14,17 +14,15 @@ namespace Tgstation.Server.Host.Database.Design
/// <inheritdoc />
public MySqlDatabaseContext CreateDbContext(string[] args)
{
using (var loggerFactory = new LoggerFactory())
{
return new MySqlDatabaseContext(
new DbContextOptions<MySqlDatabaseContext>(),
DesignTimeDbContextFactoryHelpers.GetDbContextOptions(),
new DatabaseSeeder(
new CryptographySuite(
new PasswordHasher<User>()),
new PlatformIdentifier()),
loggerFactory.CreateLogger<MySqlDatabaseContext>());
}
using var loggerFactory = new LoggerFactory();
return new MySqlDatabaseContext(
new DbContextOptions<MySqlDatabaseContext>(),
DesignTimeDbContextFactoryHelpers.GetDbContextOptions(),
new DatabaseSeeder(
new CryptographySuite(
new PasswordHasher<User>()),
new PlatformIdentifier()),
loggerFactory.CreateLogger<MySqlDatabaseContext>());
}
}
}
@@ -14,17 +14,15 @@ namespace Tgstation.Server.Host.Database.Design
/// <inheritdoc />
public SqlServerDatabaseContext CreateDbContext(string[] args)
{
using (var loggerFactory = new LoggerFactory())
{
return new SqlServerDatabaseContext(
new DbContextOptions<SqlServerDatabaseContext>(),
DesignTimeDbContextFactoryHelpers.GetDbContextOptions(),
new DatabaseSeeder(
new CryptographySuite(
new PasswordHasher<User>()),
new PlatformIdentifier()),
loggerFactory.CreateLogger<SqlServerDatabaseContext>());
}
using var loggerFactory = new LoggerFactory();
return new SqlServerDatabaseContext(
new DbContextOptions<SqlServerDatabaseContext>(),
DesignTimeDbContextFactoryHelpers.GetDbContextOptions(),
new DatabaseSeeder(
new CryptographySuite(
new PasswordHasher<User>()),
new PlatformIdentifier()),
loggerFactory.CreateLogger<SqlServerDatabaseContext>());
}
}
}
@@ -14,17 +14,15 @@ namespace Tgstation.Server.Host.Database.Design
/// <inheritdoc />
public SqliteDatabaseContext CreateDbContext(string[] args)
{
using (var loggerFactory = new LoggerFactory())
{
return new SqliteDatabaseContext(
new DbContextOptions<SqliteDatabaseContext>(),
DesignTimeDbContextFactoryHelpers.GetDbContextOptions(),
new DatabaseSeeder(
new CryptographySuite(
new PasswordHasher<User>()),
new PlatformIdentifier()),
loggerFactory.CreateLogger<SqliteDatabaseContext>());
}
using var loggerFactory = new LoggerFactory();
return new SqliteDatabaseContext(
new DbContextOptions<SqliteDatabaseContext>(),
DesignTimeDbContextFactoryHelpers.GetDbContextOptions(),
new DatabaseSeeder(
new CryptographySuite(
new PasswordHasher<User>()),
new PlatformIdentifier()),
loggerFactory.CreateLogger<SqliteDatabaseContext>());
}
}
}