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.
This commit is contained in:
OlgunR
2026-03-06 11:16:27 +01:00
parent f8ce9a03ec
commit 967fd2ba04

View File

@@ -14,6 +14,13 @@ namespace EnvelopeGenerator.Domain.Entities
[Table("TBSIG_ENVELOPE", Schema = "dbo")] [Table("TBSIG_ENVELOPE", Schema = "dbo")]
public class Envelope 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 // TODO: * Check the Form App and remove the default value
[Key] [Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)] [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
@@ -39,7 +46,7 @@ namespace EnvelopeGenerator.Domain.Entities
// TODO: * Check the Form App and remove the default value // TODO: * Check the Form App and remove the default value
[Column("MESSAGE", TypeName = "nvarchar(max)")] [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")] [Column("EXPIRES_WHEN", TypeName = "datetime")]
public DateTime ExpiresWhen { get; set; } public DateTime ExpiresWhen { get; set; }