From 50a541c5bf55f5044cfd6e608af31c96d8099452 Mon Sep 17 00:00:00 2001 From: TekH Date: Tue, 19 Aug 2025 14:14:10 +0200 Subject: [PATCH] =?UTF-8?q?refactor:=20Plattform-spezifische=20Anpassungen?= =?UTF-8?q?=20an=20der=20Receiver-Klasse=20-=20`NotMapped`=20Properties=20?= =?UTF-8?q?nur=20f=C3=BCr=20NETFRAMEWORK=20verf=C3=BCgbar=20gemacht=20-=20?= =?UTF-8?q?Klasse=20und=20Namespaces=20f=C3=BCr=20NET-=20und=20NETFRAMEWOR?= =?UTF-8?q?K-Bedingungen=20angepasst=20-=20Redundant=20in=20NET=20definier?= =?UTF-8?q?ten=20Code=20entfernt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- EnvelopeGenerator.Domain/Entities/Receiver.cs | 126 ++++++++++-------- 1 file changed, 68 insertions(+), 58 deletions(-) diff --git a/EnvelopeGenerator.Domain/Entities/Receiver.cs b/EnvelopeGenerator.Domain/Entities/Receiver.cs index 195240f9..1360875d 100644 --- a/EnvelopeGenerator.Domain/Entities/Receiver.cs +++ b/EnvelopeGenerator.Domain/Entities/Receiver.cs @@ -7,84 +7,94 @@ using System.Collections.Generic; #endif namespace EnvelopeGenerator.Domain.Entities -{ - [Table("TBSIG_RECEIVER", Schema = "dbo")] - public class Receiver +#if NET + ; +#elif NETFRAMEWORK { - [Key] - [DatabaseGenerated(DatabaseGeneratedOption.Identity)] - [Column("GUID")] - public int Id { get; set; } +#endif + +[Table("TBSIG_RECEIVER", Schema = "dbo")] +public class Receiver +{ + [Key] + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + [Column("GUID")] + public int Id { get; set; } + + [Required, EmailAddress] + [Column("EMAIL_ADDRESS", TypeName = "nvarchar(250)")] + [StringLength(250)] + public string EmailAddress { get; set; } - [Required, EmailAddress] - [Column("EMAIL_ADDRESS", TypeName = "nvarchar(250)")] - [StringLength(250)] - public string EmailAddress { get; set; } + [Required] + [Column("SIGNATURE", TypeName = "nvarchar(64)")] + public string Signature { get; set; } - [Required] - [Column("SIGNATURE", TypeName = "nvarchar(64)")] - public string Signature { get; set; } + [Required] + [Column("ADDED_WHEN", TypeName = "datetime")] + public DateTime AddedWhen { get; set; } - [Required] - [Column("ADDED_WHEN", TypeName = "datetime")] - public DateTime AddedWhen { get; set; } + [Column("TOTP_SECRET_KEY", TypeName = "nvarchar(MAX)")] + public string TotpSecretkey { get; set; } - [Column("TOTP_SECRET_KEY", TypeName = "nvarchar(MAX)")] - public string TotpSecretkey { get; set; } + [Column("TFA_REG_DEADLINE", TypeName = "datetime")] + public DateTime? TfaRegDeadline { get; set; } - [Column("TFA_REG_DEADLINE", TypeName = "datetime")] - public DateTime? TfaRegDeadline { get; set; } + public List EnvelopeReceivers { get; set; } - public List EnvelopeReceivers { get; set; } +#if NETFRAMEWORK + [NotMapped] + public string Name { get; set; } - [NotMapped] - public string Name { get; set; } + [NotMapped] + public string Company { get; set; } = string.Empty; - [NotMapped] - public string Company { get; set; } = string.Empty; + [NotMapped] + public string JobTitle { get; set; } = string.Empty; - [NotMapped] - public string JobTitle { get; set; } = string.Empty; + [NotMapped] + public string PhoneNumber { get; set; } = string.Empty; - [NotMapped] - public string PhoneNumber { get; set; } = string.Empty; + [NotMapped] + public string AccessCode { get; set; } = string.Empty; - [NotMapped] - public string AccessCode { get; set; } = string.Empty; + [NotMapped] + public string PrivateMessage { get; set; } = string.Empty; - [NotMapped] - public string PrivateMessage { get; set; } = string.Empty; + [NotMapped] + public int Sequence { get; set; } = 0; - [NotMapped] - public int Sequence { get; set; } = 0; + [NotMapped] + public DateTime SignedDate { get; set; } = DateTime.MinValue; - [NotMapped] - public DateTime SignedDate { get; set; } = DateTime.MinValue; + [NotMapped] + public Constants.ReceiverStatus Status { get; set; } - [NotMapped] - public Constants.ReceiverStatus Status { get; set; } + [NotMapped] + public Constants.ColorType ColorType { get; set; } - [NotMapped] - public Constants.ColorType ColorType { get; set; } + [NotMapped] + public bool HasId => Id > 0; - [NotMapped] - public bool HasId => Id > 0; + [NotMapped] + public bool HasEmailAndName => + !string.IsNullOrWhiteSpace(EmailAddress) && + !string.IsNullOrWhiteSpace(Name); - [NotMapped] - public bool HasEmailAndName => - !string.IsNullOrWhiteSpace(EmailAddress) && - !string.IsNullOrWhiteSpace(Name); + [NotMapped] + public string SignedDateDisplayValue => + SignedDate == DateTime.MinValue ? "-" : SignedDate.ToString("G"); - [NotMapped] - public string SignedDateDisplayValue => - SignedDate == DateTime.MinValue ? "-" : SignedDate.ToString("G"); + [NotMapped] + public Color Color => ColorType.ToColor(); - [NotMapped] - public Color Color => ColorType.ToColor(); + public string GetSignature() + { + return EmailAddress.ToUpperInvariant().GetChecksum(); + } +#endif +} - public string GetSignature() - { - return EmailAddress.ToUpperInvariant().GetChecksum(); - } +#if NETFRAMEWORK } -} \ No newline at end of file +#endif \ No newline at end of file