From 82d4b0e740cb837e1cc2413ebf0e55f9528896d7 Mon Sep 17 00:00:00 2001 From: TekH Date: Tue, 19 Aug 2025 15:02:05 +0200 Subject: [PATCH] =?UTF-8?q?refactor(EnvelopeDocument):=20=C3=9Cberarbeitun?= =?UTF-8?q?g=20der=20Klasse=20EnvelopeDocument=20f=C3=BCr=20.NET/Framework?= =?UTF-8?q?=20Kompatibilit=C3=A4t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Hinzugefügt: bedingte Namensraum-Deklaration für NET und NETFRAMEWORK - Konstruktor eingeführt mit Initialisierung von Elements (nur .NET Framework) - Entfernt: Property AddedWhen - Verschoben: FileNameOriginal, IsTempFile, Filename, Filepath, Thumbnail, PageCount → nur verfügbar unter .NET Framework - Entfernt Standardinitialisierung von Elements, stattdessen abhängig von Laufzeitumgebung --- .../Entities/EnvelopeDocument.cs | 71 +++++++++++-------- 1 file changed, 42 insertions(+), 29 deletions(-) diff --git a/EnvelopeGenerator.Domain/Entities/EnvelopeDocument.cs b/EnvelopeGenerator.Domain/Entities/EnvelopeDocument.cs index ff40a90d..6c80ed7e 100644 --- a/EnvelopeGenerator.Domain/Entities/EnvelopeDocument.cs +++ b/EnvelopeGenerator.Domain/Entities/EnvelopeDocument.cs @@ -4,49 +4,62 @@ using System.Drawing; #if NETFRAMEWORK using System; using System.Collections.Generic; +using System.Linq; #endif namespace EnvelopeGenerator.Domain.Entities +#if NET + ; +#elif NETFRAMEWORK + { +#endif + +[Table("TBSIG_ENVELOPE_DOCUMENT", Schema = "dbo")] +public class EnvelopeDocument { - [Table("TBSIG_ENVELOPE_DOCUMENT", Schema = "dbo")] - public class EnvelopeDocument + public EnvelopeDocument() { - [Key] - [DatabaseGenerated(DatabaseGeneratedOption.Identity)] - [Column("GUID")] - public int Id { get; set; } +#if NETFRAMEWORK + Elements = Enumerable.Empty().ToList(); +#endif + } - [Required] - [Column("ENVELOPE_ID")] - public int EnvelopeId { get; set; } = 0; + [Key] + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + [Column("GUID")] + public int Id { get; set; } - [Required] - [Column("ADDED_WHEN", TypeName = "datetime")] - public DateTime AddedWhen { get; set; } + [Required] + [Column("ENVELOPE_ID")] + public int EnvelopeId { get; set; } = 0; - [Column("BYTE_DATA", TypeName = "varbinary(max)")] - public byte[] ByteData { get; set; } + [Column("BYTE_DATA", TypeName = "varbinary(max)")] + public byte[] ByteData { get; set; } - public List Elements { get; set; } = new List(); + public List Elements { get; set; } + // TODO: * Check the Form App and remove the default value +#if NETFRAMEWORK + [NotMapped] + public string FileNameOriginal { get; set; } - // TODO: * Check the Form App and remove the default value - [NotMapped] - public string FileNameOriginal { get; set; } + [NotMapped] + public bool IsTempFile { get; set; } - [NotMapped] - public bool IsTempFile { get; set; } + [NotMapped] + public string Filename { get; set; } - [NotMapped] - public string Filename { get; set; } + [NotMapped] + public string Filepath { get; set; } - [NotMapped] - public string Filepath { get; set; } + [NotMapped] + public Bitmap Thumbnail { get; set; } - [NotMapped] - public Bitmap Thumbnail { get; set; } + [NotMapped] + public int PageCount { get; set; } +#endif +} - [NotMapped] - public int PageCount { get; set; } +#if NETFRAMEWORK } -} \ No newline at end of file +#endif \ No newline at end of file