Refaktorisierung der Lokalisierung und DTO-Integration

- Ersetzung von ITranslateService durch IStringLocalizer<X> für verbesserte Lokalisierung.
- Aktualisierung der DTO-Klassen entsprechend der neuesten Core.DTO-Struktur.
- Integration der neuen Klassen Result und DataResult aus Core.DTO für standardisierte Serviceantworten.
This commit is contained in:
Developer 02
2024-05-02 17:36:23 +02:00
parent a7cf500858
commit cc01f57125
32 changed files with 571 additions and 149 deletions

View File

@@ -1,4 +1,3 @@
using DigitalData.Core.CultureServices;
using DigitalData.UserManager.Infrastructure.Repositories;
using EnvelopeGenerator.Application.Contracts;
using EnvelopeGenerator.Application.MappingProfiles;
@@ -12,9 +11,10 @@ using Quartz;
using NLog.Web;
using DigitalData.Core.API;
using Microsoft.AspNetCore.Authentication.Cookies;
using DigitalData.Core.Application;
using DigitalData.UserManager.Application.MappingProfiles;
using EnvelopeGenerator.Web.Models;
using DigitalData.Core.DTO;
using Microsoft.Extensions.Localization;
var logger = LogManager.Setup().LoadConfigurationFromAppSettings().GetCurrentClassLogger();
logger.Info("Logging initialized!");
@@ -47,8 +47,6 @@ try
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
builder.Services.AddKeyTranslationService();
//AddEF Core dbcontext
var connStr = builder.Configuration["Config:ConnectionString"];
builder.Services.AddDbContext<EGDbContext>(options =>
@@ -137,6 +135,8 @@ try
builder.Services.AddCookieConsentSettings();
builder.Services.AddCookieBasedLocalizer();
var app = builder.Build();
// Configure the HTTP request pipeline.
@@ -159,6 +159,8 @@ try
app.UseAuthentication();
app.UseAuthorization();
app.UseCookieBasedLocalizer("de_DE", "en_US");
app.MapControllers();
app.MapFallbackToController("Error404", "Home");
app.Run();