From ead33ab2e7797db2b0485560bbbd04cd45176599 Mon Sep 17 00:00:00 2001 From: TekH Date: Mon, 9 Mar 2026 15:09:51 +0100 Subject: [PATCH] Refactor Envelope properties; add DefaultDocument property Refactored property declarations in the Envelope class for improved readability by removing unnecessary line breaks and nullable preprocessor directives. Added a [NotMapped] DefaultDocument property to return the first document in the Documents list, or null if none exist. --- EnvelopeGenerator.Domain/Entities/Envelope.cs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/EnvelopeGenerator.Domain/Entities/Envelope.cs b/EnvelopeGenerator.Domain/Entities/Envelope.cs index 479d7010..0889022a 100644 --- a/EnvelopeGenerator.Domain/Entities/Envelope.cs +++ b/EnvelopeGenerator.Domain/Entities/Envelope.cs @@ -154,8 +154,7 @@ namespace EnvelopeGenerator.Domain.Entities #if nullable ? #endif - Type - { get; set; } + Type { get; set; } #if NETFRAMEWORK [NotMapped] @@ -169,22 +168,26 @@ namespace EnvelopeGenerator.Domain.Entities #if nullable ? #endif - Documents - { get; set; } + Documents { get; set; } + + [NotMapped] + public Document +#if nullable + ? +#endif + DefaultDocument => Documents?.FirstOrDefault(); public List #if nullable ? #endif - Histories - { get; set; } + Histories { get; set; } public List #if nullable ? #endif - EnvelopeReceivers - { get; set; } + EnvelopeReceivers { get; set; } //#if NETFRAMEWORK ///