Condense two lamdas

This commit is contained in:
Cyberboss
2018-09-25 13:19:43 -04:00
parent 2776ca769f
commit 2af99d0aeb
@@ -154,15 +154,13 @@ namespace Tgstation.Server.Host.Core
var databaseConfiguration = databaseConfigurationSection.Get<DatabaseConfiguration>();
void ConfigureDatabase(DbContextOptionsBuilder builder)
{
if (hostingEnvironment.IsDevelopment())
builder.EnableSensitiveDataLogging();
};
void AddTypedContext<TContext>() where TContext : DatabaseContext<TContext>
{
services.AddDbContext<TContext>(ConfigureDatabase);
services.AddDbContext<TContext>(builder =>
{
if (hostingEnvironment.IsDevelopment())
builder.EnableSensitiveDataLogging();
});
services.AddScoped<IDatabaseContext>(x => x.GetRequiredService<TContext>());
}