namespace LaaProductionWeb.Blazor { using LaaPackages.Data.HeliumTester; using LaaProductionWeb.Blazor.Components; using LaaProductionWeb.Blazor.Components.CSD.Data; using LaaProductionWeb.Blazor.Components.HeliumTester.Models; using LaaProductionWeb.Blazor.Components.Identity.Services; using LaaProductionWeb.Blazor.Components.Logging.Sqlite; using LaaProductionWeb.Blazor.Infrastructure; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Components.Authorization; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; public class Program { public static void Main(string[] args) { var builder = WebApplication.CreateBuilder(args); var configuration = builder.Configuration; var logging = builder.Logging; logging.AddConfiguration(configuration); logging.ClearProviders(); logging.AddSqliteLogging(); var services = builder.Services; services.Configure(configuration.GetSection(nameof(ConnectionStrings))); services.Configure(configuration.GetSection(nameof(SqliteLoggerOptions))); services.AddDbContext(options => { var connectionString = configuration .GetSection(nameof(ConnectionStrings)) .GetValue(nameof(ConnectionStrings.Auftrag)); options.UseSqlServer(connectionString); options.EnableDetailedErrors(); options.EnableSensitiveDataLogging(); }); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddSingleton(); services.AddTransient(); services.AddRazorComponents(options => options.DetailedErrors = true) .AddInteractiveServerComponents(options => options.DetailedErrors = true); services.AddAuthenticationCore(); services.AddAuthorizationCore(); services.AddCascadingAuthenticationState(); services.AddScoped(); var app = builder.Build(); if (!app.Environment.IsDevelopment()) { app.UseHsts(); } app.UseHttpsRedirection(); app.UseAntiforgery(); app.UseAuthentication(); app.UseAuthorization(); app.MapStaticAssets(); app.MapRazorComponents() .AddInteractiveServerRenderMode(); app.Run(); } } }