From 285cc6abb75aefcec7fb71525775e7a37e0598bb Mon Sep 17 00:00:00 2001 From: Anatolii Hrynchuk Date: Sun, 17 May 2026 11:18:05 +0300 Subject: [PATCH] refactor: simplify `Program.cs` and clean up `NuGet.Config` --- HrynCo.NotificationService.Web/Program.cs | 19 ++++++++----------- NuGet.Config | 3 --- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/HrynCo.NotificationService.Web/Program.cs b/HrynCo.NotificationService.Web/Program.cs index 01bc011..cf50e59 100644 --- a/HrynCo.NotificationService.Web/Program.cs +++ b/HrynCo.NotificationService.Web/Program.cs @@ -3,11 +3,11 @@ using HrynCo.NotificationService.DAL.EF; using HrynCo.NotificationService.Services; using Scalar.AspNetCore; -var builder = WebApplication.CreateBuilder(args); +WebApplicationBuilder builder = WebApplication.CreateBuilder(args); builder.AddSerilog(); -var appSettings = builder.Configuration +AppSettings appSettings = builder.Configuration .GetSection(AppSettings.SectionName) .Get() ?? throw new InvalidOperationException("App settings are not configured."); @@ -18,17 +18,14 @@ builder.Services.AddControllersWithViews() builder.Services.AddNotificationDataAccess(appSettings.ConnectionString); builder.Services.AddNotificationServices(); -var app = builder.Build(); +WebApplication app = builder.Build(); -if (app.Environment.IsDevelopment()) +app.MapOpenApi(); +app.MapScalarApiReference(options => { - app.MapOpenApi(); - app.MapScalarApiReference(options => - { - options.Title = "HrynCo Notification Service"; - options.Theme = ScalarTheme.DeepSpace; - }); -} + options.Title = "HrynCo Notification Service"; + options.Theme = ScalarTheme.DeepSpace; +}); app.UseStaticFiles(); app.UseHttpsRedirection(); diff --git a/NuGet.Config b/NuGet.Config index 46fd5b4..6873eb9 100644 --- a/NuGet.Config +++ b/NuGet.Config @@ -1,8 +1,5 @@ - - -