Erweiterung der DTOs und Implementierung der Lokalisierungsdienste
- Neue DTO-Extension-Methoden hinzugefügt, um die Verarbeitung und Zuweisung von Nachrichten und Benachrichtigungen in Ergebnisobjekten zu vereinfachen. - Lokalisierungsunterstützung in der API-Schicht implementiert, einschließlich Cookie-basierter Lokalisierung und Konfiguration unterstützter Kulturen. - Die Integration von StringLocalizer in die API-Schicht wurde durchgeführt, um eine nahtlose Mehrsprachigkeit zu ermöglichen. - Fehlerbehandlung für fehlende Konfigurationseinstellungen verbessert. Die Änderungen verbessern die Flexibilität und Wartbarkeit des Codes und unterstützen eine effizientere Internationalisierung der Anwendung.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using DigitalData.Core.Contracts.Application;
|
||||
using DigitalData.Core.DTO;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Text;
|
||||
|
||||
@@ -50,10 +51,8 @@ namespace DigitalData.Core.API
|
||||
/// Returns an ObjectResult representing an internal server error (status code 500) with optional exception and message details.
|
||||
/// </summary>
|
||||
/// <param name="controllerBase">The ControllerBase instance representing the controller.</param>
|
||||
/// <param name="ex">Optional. The exception that occurred, if any.</param>
|
||||
/// <param name="message">Optional. A custom error message to include in the response.</param>
|
||||
/// /// <param name="messageKey">Optional. A custom error message key to include in the response.</param>
|
||||
/// <param name="result">Optional. A custom error resul to include in the response.</param>
|
||||
/// <returns>An ObjectResult representing an internal server error (status code 500).</returns>
|
||||
public static ObjectResult InnerServiceError(this ControllerBase controllerBase, IServiceMessage? serviceMessage = null) => controllerBase.StatusCode(500, serviceMessage);
|
||||
public static ObjectResult InnerServiceError(this ControllerBase controllerBase, Result? result = null) => controllerBase.StatusCode(500, result);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user