Skip to content

Commit a25b4b2

Browse files
refactor the code to explicitly create the provider variable when using, improving clarity when obtaining ISettings.
1 parent 819b688 commit a25b4b2

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

Boundaries/Comanda.Subscriptions/Source/Comanda.Subscriptions.WebApi/Extensions/MonitoringExtension.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ public static void AddMonitoring(this WebApplicationBuilder builder)
88
if (!builder.Environment.IsDevelopment() && !builder.Environment.IsProduction())
99
return;
1010

11-
var settings = builder.Services
12-
.BuildServiceProvider()
13-
.GetRequiredService<ISettings>();
11+
var provider = builder.Services.BuildServiceProvider();
12+
var settings = provider.GetRequiredService<ISettings>();
1413

1514
// https://docs.sentry.io/platforms/dotnet/
1615
builder.WebHost.UseSentry(options =>

0 commit comments

Comments
 (0)