From 967fd2ba04db1d952121b03c1e3066b181eec070 Mon Sep 17 00:00:00 2001 From: OlgunR Date: Fri, 6 Mar 2026 11:16:27 +0100 Subject: [PATCH] Set Message default via ctor for .NET Framework only Removed default value assignment from Message property and added a constructor to set the default message only when compiling for .NET Framework, using conditional compilation. This improves cross-platform compatibility. --- EnvelopeGenerator.Domain/Entities/Envelope.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/EnvelopeGenerator.Domain/Entities/Envelope.cs b/EnvelopeGenerator.Domain/Entities/Envelope.cs index f4a8ea6a..03bb3464 100644 --- a/EnvelopeGenerator.Domain/Entities/Envelope.cs +++ b/EnvelopeGenerator.Domain/Entities/Envelope.cs @@ -14,6 +14,13 @@ namespace EnvelopeGenerator.Domain.Entities [Table("TBSIG_ENVELOPE", Schema = "dbo")] public class Envelope { + public Envelope() + { +#if NETFRAMEWORK + Message = My.Resources.Envelope.Please_read_and_sign_this_document; +#endif + } + // TODO: * Check the Form App and remove the default value [Key] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] @@ -39,7 +46,7 @@ namespace EnvelopeGenerator.Domain.Entities // TODO: * Check the Form App and remove the default value [Column("MESSAGE", TypeName = "nvarchar(max)")] - public string Message { get; set; } = My.Resources.Envelope.Please_read_and_sign_this_document; + public string Message { get; set; } [Column("EXPIRES_WHEN", TypeName = "datetime")] public DateTime ExpiresWhen { get; set; }