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 -{ - [Table("TBSIG_ENVELOPE_DOCUMENT", Schema = "dbo")] - public class EnvelopeDocument +#if NET + ; +#elif NETFRAMEWORK { - [Key] - [DatabaseGenerated(DatabaseGeneratedOption.Identity)] - [Column("GUID")] - public int Id { get; set; } +#endif - [Required] - [Column("ENVELOPE_ID")] - public int EnvelopeId { get; set; } = 0; - - [Required] - [Column("ADDED_WHEN", TypeName = "datetime")] - public DateTime AddedWhen { get; set; } - - [Column("BYTE_DATA", TypeName = "varbinary(max)")] - public byte[] ByteData { get; set; } - - public List Elements { get; set; } = new List(); - - - // TODO: * Check the Form App and remove the default value - [NotMapped] - public string FileNameOriginal { get; set; } - - [NotMapped] - public bool IsTempFile { get; set; } - - [NotMapped] - public string Filename { get; set; } - - [NotMapped] - public string Filepath { get; set; } - - [NotMapped] - public Bitmap Thumbnail { get; set; } - - [NotMapped] - public int PageCount { get; set; } +[Table("TBSIG_ENVELOPE_DOCUMENT", Schema = "dbo")] +public class EnvelopeDocument +{ + public EnvelopeDocument() + { +#if NETFRAMEWORK + Elements = Enumerable.Empty().ToList(); +#endif } -} \ No newline at end of file + + [Key] + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + [Column("GUID")] + public int Id { get; set; } + + [Required] + [Column("ENVELOPE_ID")] + public int EnvelopeId { get; set; } = 0; + + [Column("BYTE_DATA", TypeName = "varbinary(max)")] + public byte[] ByteData { get; set; } + + public List Elements { get; set; } + + // TODO: * Check the Form App and remove the default value +#if NETFRAMEWORK + [NotMapped] + public string FileNameOriginal { get; set; } + + [NotMapped] + public bool IsTempFile { get; set; } + + [NotMapped] + public string Filename { get; set; } + + [NotMapped] + public string Filepath { get; set; } + + [NotMapped] + public Bitmap Thumbnail { get; set; } + + [NotMapped] + public int PageCount { get; set; } +#endif +} + +#if NETFRAMEWORK + } +#endif \ No newline at end of file