- Methode `FillTemplate` für Platzhalterersetzung hinzugefügt. - `TemplatePlaceholderAttribute` eingeführt. - `EmailOutService` mit Vorlagenmethoden aktualisiert. - Unit-Tests für Vorlagenverarbeitung hinzugefügt.
41 lines
1.0 KiB
C#
41 lines
1.0 KiB
C#
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<Resource>(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<IStringLocalizer, StringLocalizer<Resource>>();
|
|
|
|
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();
|