- Updated EmailTemplateDto to allow mutable Body and Subject properties. - Implemented IRequest interface in UpdateEmailTemplateCommand for MediatR. - Enhanced error handling in EmailTemplateController with NotFoundException. - Introduced UpdateEmailTemplateCommandHandler for processing update commands. - Added NotFoundException class for improved error handling.
24 lines
796 B
C#
24 lines
796 B
C#
using MediatR;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace EnvelopeGenerator.Application.EmailTemplates.Commands.Update;
|
|
|
|
|
|
/// <summary>
|
|
/// Befehl zum Aktualisieren einer E-Mail-Vorlage.
|
|
/// </summary>
|
|
/// <param name="Body">
|
|
/// (Optional)Der neue Inhalt des E-Mail-Textkörpers. Wenn null, bleibt der vorhandene Inhalt unverändert.
|
|
/// </param>
|
|
/// <param name="Subject">
|
|
/// (Optional) Der neue Betreff der E-Mail. Wenn null, bleibt der vorhandene Betreff unverändert.
|
|
/// </param>
|
|
public record UpdateEmailTemplateCommand(string? Body = null, string? Subject = null) : IRequest
|
|
{
|
|
/// <param>
|
|
/// Die Abfrage, die die E-Mail-Vorlage darstellt, die aktualisiert werden soll.
|
|
/// </param>
|
|
[JsonIgnore]
|
|
public EmailTemplateQuery? EmailTemplateQuery { get; set; }
|
|
}
|