From 2af99d0aeb7cf6e023b2514ccd87338d4941fad6 Mon Sep 17 00:00:00 2001 From: Cyberboss Date: Tue, 25 Sep 2018 13:19:43 -0400 Subject: [PATCH] Condense two lamdas --- src/Tgstation.Server.Host/Core/Application.cs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/Tgstation.Server.Host/Core/Application.cs b/src/Tgstation.Server.Host/Core/Application.cs index 1e6a0d62d3..0f347f1d08 100644 --- a/src/Tgstation.Server.Host/Core/Application.cs +++ b/src/Tgstation.Server.Host/Core/Application.cs @@ -154,15 +154,13 @@ namespace Tgstation.Server.Host.Core var databaseConfiguration = databaseConfigurationSection.Get(); - void ConfigureDatabase(DbContextOptionsBuilder builder) - { - if (hostingEnvironment.IsDevelopment()) - builder.EnableSensitiveDataLogging(); - }; - void AddTypedContext() where TContext : DatabaseContext { - services.AddDbContext(ConfigureDatabase); + services.AddDbContext(builder => + { + if (hostingEnvironment.IsDevelopment()) + builder.EnableSensitiveDataLogging(); + }); services.AddScoped(x => x.GetRequiredService()); }