TekH 69821e64c6 refactor(Document): update Document entity structure and file properties
- Moved file-related properties (Filename, Filepath, FileNameOriginal) into dedicated region
- Added column mappings for file-related properties
- Changed Elements type to IEnumerable<Signature> for better abstraction
- Adjusted EnvelopeId default initialization for NETFRAMEWORK only
- Updated ByteData and nullable types for NET compatibility
- Removed obsolete default value and simplified property definitions
2025-10-14 10:53:19 +02:00

88 lines
1.7 KiB
C#

using EnvelopeGenerator.Domain.Interfaces;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
#if NETFRAMEWORK
using System.Drawing;
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 Document : IHasEnvelope
{
public Document()
{
#if NETFRAMEWORK
Elements = Enumerable.Empty<Signature>().ToList();
#endif
}
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
[Column("GUID")]
public int Id { get; set; }
[Required]
[Column("ENVELOPE_ID")]
public int EnvelopeId { get; set; }
#if NETFRAMEWORK
= 0;
#endif
[Column("BYTE_DATA", TypeName = "varbinary(max)")]
public byte[]
#if NET
?
#endif
ByteData { get; set; }
#region File
[Column("FILENAME", TypeName = "nvarchar(256)")]
public string Filename { get; set; }
[Column("FILEPATH", TypeName = "nvarchar(256)")]
public string Filepath { get; set; }
[Column("FILENAME_ORIGINAL", TypeName = "nvarchar(256)")]
public string
#if NET
?
#endif
FileNameOriginal { get; set; }
#endregion
public virtual List<Signature>
#if NET
?
#endif
Elements { get; set; }
[ForeignKey("EnvelopeId")]
public virtual Envelope
#if NET
?
#endif
Envelope { get; set; }
#if NETFRAMEWORK
[NotMapped]
public bool IsTempFile { get; set; }
[NotMapped]
public Bitmap Thumbnail { get; set; }
[NotMapped]
public int PageCount { get; set; }
#endif
}
#if NETFRAMEWORK
}
#endif