Update ReceiverGetOrCreateCommand email handling

Changed _emailAddress from nullable to non-nullable,
initialized to an empty string. Updated EmailAddress
property to be required, with modified getter and setter
to ensure lowercase formatting.
This commit is contained in:
Developer 02 2025-05-08 10:25:06 +02:00
parent d873d6dcf1
commit 2db0748e60

View File

@ -25,12 +25,13 @@ public record Signature([Required] double X, [Required] double Y, [Required] int
/// <param name="PhoneNumber">Sollte mit Vorwahl geschrieben werden</param>
public record ReceiverGetOrCreateCommand([Required] IEnumerable<Signature> Signatures, string? Salution = null, string? PhoneNumber = null)
{
private string? _emailAddress;
private string _emailAddress = string.Empty;
/// <summary>
/// E-Mail-Adresse des Empfängers.
/// </summary>
public string? EmailAddress { get => _emailAddress?.ToLower(); init => _emailAddress = _emailAddress?.ToLower(); }
[Required]
public string EmailAddress { get => _emailAddress.ToLower(); init => _emailAddress = value.ToLower(); }
};
/// <summary>