using DigitalData.Core.API; using DigitalData.EmailProfilerDispatcher.API.Resources; using DigitalData.EmailProfilerDispatcher.Application; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Localization; var builder = WebApplication.CreateBuilder(args); var config = builder.Configuration; // Add services to the container. builder.Services.AddControllers(); builder.Services.AddCookieBasedLocalizer(); builder.Services.AddDispatcher(options => options.UseSqlServer(config.GetConnectionString("Default"))); // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); builder.Services.AddSingleton>(); var app = builder.Build(); // Configure the HTTP request pipeline. if (app.Environment.IsDevelopment()) { app.UseSwagger(); app.UseSwaggerUI(); } app.UseHttpsRedirection(); app.UseAuthorization(); app.UseCookieBasedLocalizer("de-DE", "en-US"); app.MapControllers(); app.Run();