mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-30 08:33:19 +01:00
Minor code updates
This commit is contained in:
@@ -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>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user