Refactor entities: remove preprocessor directives, unify style

Large-scale cleanup of entity and interface classes:
- Removed obsolete #if NET/NETFRAMEWORK preprocessor blocks
- Unified class/property formatting and indentation
- Standardized use of data annotations
- Improved nullable reference type handling
- Simplified interfaces (IHasEnvelope, IHasReceiver)
- Removed redundant and dead code
- No changes to business logic or data model

These changes modernize and standardize the codebase for easier maintenance and .NET compatibility.
This commit is contained in:
2026-02-09 15:32:41 +01:00
parent e2afbc5a62
commit 910a870ddf
9 changed files with 321 additions and 409 deletions

View File

@@ -2,12 +2,7 @@
using System.ComponentModel.DataAnnotations.Schema;
namespace EnvelopeGenerator.Domain.Entities
#if NET
;
#elif NETFRAMEWORK
{
#endif
[Table("TBSIG_CONFIG", Schema = "dbo")]
public class Config
{
@@ -25,7 +20,4 @@ public class Config
[Column("EXPORT_PATH", TypeName = "nvarchar(256)")]
public string ExportPath { get; set; }
}
#if NETFRAMEWORK
}
#endif

View File

@@ -9,12 +9,7 @@ using System.Linq;
#endif
namespace EnvelopeGenerator.Domain.Entities
#if NET
;
#elif NETFRAMEWORK
{
#endif
[Table("TBSIG_ENVELOPE_DOCUMENT", Schema = "dbo")]
public class Document : IHasEnvelope, IHasAddedWhen
{
@@ -87,7 +82,4 @@ public class Document : IHasEnvelope, IHasAddedWhen
public int PageCount { get; set; }
#endif
}
#if NETFRAMEWORK
}
#endif

View File

@@ -4,16 +4,8 @@ using System.ComponentModel.DataAnnotations.Schema;
using DigitalData.Core.Abstractions.Interfaces;
using EnvelopeGenerator.Domain.Interfaces;
#if NETFRAMEWORK
#endif
namespace EnvelopeGenerator.Domain.Entities
#if NET
;
#elif NETFRAMEWORK
{
#endif
[Table("TBSIG_DOCUMENT_STATUS", Schema = "dbo")]
public class DocumentStatus : IHasEnvelope, IHasReceiver, IEntity, IHasAddedWhen, IHasChangedWhen
{
@@ -54,19 +46,16 @@ public class DocumentStatus : IHasEnvelope, IHasReceiver, IEntity, IHasAddedWhen
[ForeignKey("EnvelopeId")]
public virtual Envelope
#if NET
#if nullable
?
#endif
Envelope { get; set; }
[ForeignKey("ReceiverId")]
public virtual Receiver
#if NET
#if nullable
?
#endif
Receiver { get; set; }
}
#if NETFRAMEWORK
}
#endif

View File

@@ -6,12 +6,7 @@ using System.ComponentModel.DataAnnotations.Schema;
#endif
namespace EnvelopeGenerator.Domain.Entities
#if NET
;
#elif NETFRAMEWORK
{
#endif
[Table("TBSIG_DOCUMENT_RECEIVER_ELEMENT_ANNOTATION")]
public class ElementAnnotation : IHasAddedWhen, IHasChangedWhen, IHasChangedWho
{
@@ -39,28 +34,28 @@ public class ElementAnnotation : IHasAddedWhen, IHasChangedWhen, IHasChangedWho
[Column("POSITION_X", TypeName = "float")]
public double
#if NET
#if nullable
?
#endif
X { get; set; }
[Column("POSITION_Y", TypeName = "float")]
public double
#if NET
#if nullable
?
#endif
Y { get; set; }
[Column("WIDTH", TypeName = "float")]
public double
#if NET
#if nullable
?
#endif
Width { get; set; }
[Column("HEIGHT", TypeName = "float")]
public double
#if NET
#if nullable
?
#endif
Height { get; set; }
@@ -87,7 +82,4 @@ public class ElementAnnotation : IHasAddedWhen, IHasChangedWhen, IHasChangedWho
#endif
Element { get; set; }
}
#if NETFRAMEWORK
}
#endif

View File

@@ -4,16 +4,9 @@ using EnvelopeGenerator.Domain.Interfaces;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
#if NETFRAMEWORK
#endif
namespace EnvelopeGenerator.Domain.Entities
#if NET
;
#elif NETFRAMEWORK
{
#endif
[Table("TBSIG_EMAIL_TEMPLATE", Schema = "dbo")]
public class EmailTemplate : IEntity, IHasAddedWhen, IHasChangedWhen
{
@@ -39,7 +32,4 @@ public class EmailTemplate : IEntity, IHasAddedWhen, IHasChangedWhen
[Column("CHANGED_WHEN", TypeName = "datetime")]
public DateTime? ChangedWhen { get; set; }
}
#if NETFRAMEWORK
}
#endif

View File

@@ -4,16 +4,8 @@ using System.ComponentModel.DataAnnotations.Schema;
using DigitalData.Core.Abstractions.Interfaces;
using EnvelopeGenerator.Domain.Interfaces;
#if NETFRAMEWORK
#endif
namespace EnvelopeGenerator.Domain.Entities
#if NET
;
#elif NETFRAMEWORK
{
#endif
[Table("TBSIG_ENVELOPE_RECEIVER", Schema = "dbo")]
public class EnvelopeReceiver : IHasEnvelope, IHasReceiver, IEntity, IHasAddedWhen, IHasChangedWhen
{
@@ -94,11 +86,6 @@ public class EnvelopeReceiver : IHasEnvelope, IHasReceiver, IEntity, IHasAddedWh
[NotMapped]
public bool HasEmailAndName =>
!string.IsNullOrWhiteSpace(Receiver.EmailAddress) &&
!string.IsNullOrWhiteSpace(Name);
#endregion
}
#if NETFRAMEWORK
}
#endif

View File

@@ -7,12 +7,7 @@ using EnvelopeGenerator.Domain.Constants;
using DigitalData.Core.Abstractions.Interfaces;
namespace EnvelopeGenerator.Domain.Entities
#if NET
;
#elif NETFRAMEWORK
{
#endif
[Table("TBSIG_ENVELOPE_HISTORY", Schema = "dbo")]
public class History : IHasEnvelope, IHasReceiver, IEntity, IHasAddedWhen, IHasChangedWhen
{
@@ -43,28 +38,28 @@ public class History : IHasEnvelope, IHasReceiver, IEntity, IHasAddedWhen, IHasC
[Column("COMMENT", TypeName = "nvarchar(max)")]
public string
#if NET
#if nullable
?
#endif
Comment { get; set; }
[ForeignKey("EnvelopeId")]
public virtual Envelope
#if NET
#if nullable
?
#endif
Envelope { get; set; }
[ForeignKey("UserReference")]
public virtual User
#if NET
#if nullable
?
#endif
Sender { get; set; }
[ForeignKey("UserReference")]
public virtual Receiver
#if NET
#if nullable
?
#endif
Receiver { get; set; }
@@ -74,7 +69,4 @@ public class History : IHasEnvelope, IHasReceiver, IEntity, IHasAddedWhen, IHasC
public string StatusTranslated => My.Resources.Model.ResourceManager.GetString(Status.ToString());
#endif
}
#if NETFRAMEWORK
}
#endif

View File

@@ -1,22 +1,11 @@
namespace EnvelopeGenerator.Domain.Interfaces
#if NET
;
#elif NETFRAMEWORK
{
#endif
public interface IHasEnvelope
{
#if NET
public
#endif
Entities.Envelope
#if NET
#if nullable
?
#endif
Envelope { get; set; }
}
#if NETFRAMEWORK
}
#endif

View File

@@ -1,22 +1,11 @@
namespace EnvelopeGenerator.Domain.Interfaces
#if NET
;
#elif NETFRAMEWORK
{
#endif
public interface IHasReceiver
{
#if NET
public
#endif
Entities.Receiver
#if NET
#if nullable
?
#endif
Receiver { get; set; }
}
#if NETFRAMEWORK
}
#endif