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:
@@ -2,12 +2,7 @@
|
|||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Domain.Entities
|
namespace EnvelopeGenerator.Domain.Entities
|
||||||
#if NET
|
|
||||||
;
|
|
||||||
#elif NETFRAMEWORK
|
|
||||||
{
|
{
|
||||||
#endif
|
|
||||||
|
|
||||||
[Table("TBSIG_CONFIG", Schema = "dbo")]
|
[Table("TBSIG_CONFIG", Schema = "dbo")]
|
||||||
public class Config
|
public class Config
|
||||||
{
|
{
|
||||||
@@ -25,7 +20,4 @@ public class Config
|
|||||||
[Column("EXPORT_PATH", TypeName = "nvarchar(256)")]
|
[Column("EXPORT_PATH", TypeName = "nvarchar(256)")]
|
||||||
public string ExportPath { get; set; }
|
public string ExportPath { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
#if NETFRAMEWORK
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
@@ -9,12 +9,7 @@ using System.Linq;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Domain.Entities
|
namespace EnvelopeGenerator.Domain.Entities
|
||||||
#if NET
|
|
||||||
;
|
|
||||||
#elif NETFRAMEWORK
|
|
||||||
{
|
{
|
||||||
#endif
|
|
||||||
|
|
||||||
[Table("TBSIG_ENVELOPE_DOCUMENT", Schema = "dbo")]
|
[Table("TBSIG_ENVELOPE_DOCUMENT", Schema = "dbo")]
|
||||||
public class Document : IHasEnvelope, IHasAddedWhen
|
public class Document : IHasEnvelope, IHasAddedWhen
|
||||||
{
|
{
|
||||||
@@ -87,7 +82,4 @@ public class Document : IHasEnvelope, IHasAddedWhen
|
|||||||
public int PageCount { get; set; }
|
public int PageCount { get; set; }
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if NETFRAMEWORK
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
@@ -4,16 +4,8 @@ using System.ComponentModel.DataAnnotations.Schema;
|
|||||||
using DigitalData.Core.Abstractions.Interfaces;
|
using DigitalData.Core.Abstractions.Interfaces;
|
||||||
using EnvelopeGenerator.Domain.Interfaces;
|
using EnvelopeGenerator.Domain.Interfaces;
|
||||||
|
|
||||||
#if NETFRAMEWORK
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Domain.Entities
|
namespace EnvelopeGenerator.Domain.Entities
|
||||||
#if NET
|
|
||||||
;
|
|
||||||
#elif NETFRAMEWORK
|
|
||||||
{
|
{
|
||||||
#endif
|
|
||||||
|
|
||||||
[Table("TBSIG_DOCUMENT_STATUS", Schema = "dbo")]
|
[Table("TBSIG_DOCUMENT_STATUS", Schema = "dbo")]
|
||||||
public class DocumentStatus : IHasEnvelope, IHasReceiver, IEntity, IHasAddedWhen, IHasChangedWhen
|
public class DocumentStatus : IHasEnvelope, IHasReceiver, IEntity, IHasAddedWhen, IHasChangedWhen
|
||||||
{
|
{
|
||||||
@@ -54,19 +46,16 @@ public class DocumentStatus : IHasEnvelope, IHasReceiver, IEntity, IHasAddedWhen
|
|||||||
|
|
||||||
[ForeignKey("EnvelopeId")]
|
[ForeignKey("EnvelopeId")]
|
||||||
public virtual Envelope
|
public virtual Envelope
|
||||||
#if NET
|
#if nullable
|
||||||
?
|
?
|
||||||
#endif
|
#endif
|
||||||
Envelope { get; set; }
|
Envelope { get; set; }
|
||||||
|
|
||||||
[ForeignKey("ReceiverId")]
|
[ForeignKey("ReceiverId")]
|
||||||
public virtual Receiver
|
public virtual Receiver
|
||||||
#if NET
|
#if nullable
|
||||||
?
|
?
|
||||||
#endif
|
#endif
|
||||||
Receiver { get; set; }
|
Receiver { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
#if NETFRAMEWORK
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
@@ -6,12 +6,7 @@ using System.ComponentModel.DataAnnotations.Schema;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Domain.Entities
|
namespace EnvelopeGenerator.Domain.Entities
|
||||||
#if NET
|
|
||||||
;
|
|
||||||
#elif NETFRAMEWORK
|
|
||||||
{
|
{
|
||||||
#endif
|
|
||||||
|
|
||||||
[Table("TBSIG_DOCUMENT_RECEIVER_ELEMENT_ANNOTATION")]
|
[Table("TBSIG_DOCUMENT_RECEIVER_ELEMENT_ANNOTATION")]
|
||||||
public class ElementAnnotation : IHasAddedWhen, IHasChangedWhen, IHasChangedWho
|
public class ElementAnnotation : IHasAddedWhen, IHasChangedWhen, IHasChangedWho
|
||||||
{
|
{
|
||||||
@@ -39,28 +34,28 @@ public class ElementAnnotation : IHasAddedWhen, IHasChangedWhen, IHasChangedWho
|
|||||||
|
|
||||||
[Column("POSITION_X", TypeName = "float")]
|
[Column("POSITION_X", TypeName = "float")]
|
||||||
public double
|
public double
|
||||||
#if NET
|
#if nullable
|
||||||
?
|
?
|
||||||
#endif
|
#endif
|
||||||
X { get; set; }
|
X { get; set; }
|
||||||
|
|
||||||
[Column("POSITION_Y", TypeName = "float")]
|
[Column("POSITION_Y", TypeName = "float")]
|
||||||
public double
|
public double
|
||||||
#if NET
|
#if nullable
|
||||||
?
|
?
|
||||||
#endif
|
#endif
|
||||||
Y { get; set; }
|
Y { get; set; }
|
||||||
|
|
||||||
[Column("WIDTH", TypeName = "float")]
|
[Column("WIDTH", TypeName = "float")]
|
||||||
public double
|
public double
|
||||||
#if NET
|
#if nullable
|
||||||
?
|
?
|
||||||
#endif
|
#endif
|
||||||
Width { get; set; }
|
Width { get; set; }
|
||||||
|
|
||||||
[Column("HEIGHT", TypeName = "float")]
|
[Column("HEIGHT", TypeName = "float")]
|
||||||
public double
|
public double
|
||||||
#if NET
|
#if nullable
|
||||||
?
|
?
|
||||||
#endif
|
#endif
|
||||||
Height { get; set; }
|
Height { get; set; }
|
||||||
@@ -87,7 +82,4 @@ public class ElementAnnotation : IHasAddedWhen, IHasChangedWhen, IHasChangedWho
|
|||||||
#endif
|
#endif
|
||||||
Element { get; set; }
|
Element { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
#if NETFRAMEWORK
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
@@ -4,16 +4,9 @@ using EnvelopeGenerator.Domain.Interfaces;
|
|||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
#if NETFRAMEWORK
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Domain.Entities
|
namespace EnvelopeGenerator.Domain.Entities
|
||||||
#if NET
|
|
||||||
;
|
|
||||||
#elif NETFRAMEWORK
|
|
||||||
{
|
{
|
||||||
#endif
|
|
||||||
|
|
||||||
[Table("TBSIG_EMAIL_TEMPLATE", Schema = "dbo")]
|
[Table("TBSIG_EMAIL_TEMPLATE", Schema = "dbo")]
|
||||||
public class EmailTemplate : IEntity, IHasAddedWhen, IHasChangedWhen
|
public class EmailTemplate : IEntity, IHasAddedWhen, IHasChangedWhen
|
||||||
{
|
{
|
||||||
@@ -39,7 +32,4 @@ public class EmailTemplate : IEntity, IHasAddedWhen, IHasChangedWhen
|
|||||||
[Column("CHANGED_WHEN", TypeName = "datetime")]
|
[Column("CHANGED_WHEN", TypeName = "datetime")]
|
||||||
public DateTime? ChangedWhen { get; set; }
|
public DateTime? ChangedWhen { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
#if NETFRAMEWORK
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
@@ -4,16 +4,8 @@ using System.ComponentModel.DataAnnotations.Schema;
|
|||||||
using DigitalData.Core.Abstractions.Interfaces;
|
using DigitalData.Core.Abstractions.Interfaces;
|
||||||
using EnvelopeGenerator.Domain.Interfaces;
|
using EnvelopeGenerator.Domain.Interfaces;
|
||||||
|
|
||||||
#if NETFRAMEWORK
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Domain.Entities
|
namespace EnvelopeGenerator.Domain.Entities
|
||||||
#if NET
|
|
||||||
;
|
|
||||||
#elif NETFRAMEWORK
|
|
||||||
{
|
{
|
||||||
#endif
|
|
||||||
|
|
||||||
[Table("TBSIG_ENVELOPE_RECEIVER", Schema = "dbo")]
|
[Table("TBSIG_ENVELOPE_RECEIVER", Schema = "dbo")]
|
||||||
public class EnvelopeReceiver : IHasEnvelope, IHasReceiver, IEntity, IHasAddedWhen, IHasChangedWhen
|
public class EnvelopeReceiver : IHasEnvelope, IHasReceiver, IEntity, IHasAddedWhen, IHasChangedWhen
|
||||||
{
|
{
|
||||||
@@ -94,11 +86,6 @@ public class EnvelopeReceiver : IHasEnvelope, IHasReceiver, IEntity, IHasAddedWh
|
|||||||
|
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
public bool HasEmailAndName =>
|
public bool HasEmailAndName =>
|
||||||
!string.IsNullOrWhiteSpace(Receiver.EmailAddress) &&
|
|
||||||
!string.IsNullOrWhiteSpace(Name);
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
#if NETFRAMEWORK
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
@@ -7,12 +7,7 @@ using EnvelopeGenerator.Domain.Constants;
|
|||||||
using DigitalData.Core.Abstractions.Interfaces;
|
using DigitalData.Core.Abstractions.Interfaces;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Domain.Entities
|
namespace EnvelopeGenerator.Domain.Entities
|
||||||
#if NET
|
|
||||||
;
|
|
||||||
#elif NETFRAMEWORK
|
|
||||||
{
|
{
|
||||||
#endif
|
|
||||||
|
|
||||||
[Table("TBSIG_ENVELOPE_HISTORY", Schema = "dbo")]
|
[Table("TBSIG_ENVELOPE_HISTORY", Schema = "dbo")]
|
||||||
public class History : IHasEnvelope, IHasReceiver, IEntity, IHasAddedWhen, IHasChangedWhen
|
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)")]
|
[Column("COMMENT", TypeName = "nvarchar(max)")]
|
||||||
public string
|
public string
|
||||||
#if NET
|
#if nullable
|
||||||
?
|
?
|
||||||
#endif
|
#endif
|
||||||
Comment { get; set; }
|
Comment { get; set; }
|
||||||
|
|
||||||
[ForeignKey("EnvelopeId")]
|
[ForeignKey("EnvelopeId")]
|
||||||
public virtual Envelope
|
public virtual Envelope
|
||||||
#if NET
|
#if nullable
|
||||||
?
|
?
|
||||||
#endif
|
#endif
|
||||||
Envelope { get; set; }
|
Envelope { get; set; }
|
||||||
|
|
||||||
[ForeignKey("UserReference")]
|
[ForeignKey("UserReference")]
|
||||||
public virtual User
|
public virtual User
|
||||||
#if NET
|
#if nullable
|
||||||
?
|
?
|
||||||
#endif
|
#endif
|
||||||
Sender { get; set; }
|
Sender { get; set; }
|
||||||
|
|
||||||
[ForeignKey("UserReference")]
|
[ForeignKey("UserReference")]
|
||||||
public virtual Receiver
|
public virtual Receiver
|
||||||
#if NET
|
#if nullable
|
||||||
?
|
?
|
||||||
#endif
|
#endif
|
||||||
Receiver { get; set; }
|
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());
|
public string StatusTranslated => My.Resources.Model.ResourceManager.GetString(Status.ToString());
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if NETFRAMEWORK
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
@@ -1,22 +1,11 @@
|
|||||||
namespace EnvelopeGenerator.Domain.Interfaces
|
namespace EnvelopeGenerator.Domain.Interfaces
|
||||||
#if NET
|
|
||||||
;
|
|
||||||
#elif NETFRAMEWORK
|
|
||||||
{
|
{
|
||||||
#endif
|
|
||||||
|
|
||||||
public interface IHasEnvelope
|
public interface IHasEnvelope
|
||||||
{
|
{
|
||||||
#if NET
|
|
||||||
public
|
|
||||||
#endif
|
|
||||||
Entities.Envelope
|
Entities.Envelope
|
||||||
#if NET
|
#if nullable
|
||||||
?
|
?
|
||||||
#endif
|
#endif
|
||||||
Envelope { get; set; }
|
Envelope { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
#if NETFRAMEWORK
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
@@ -1,22 +1,11 @@
|
|||||||
namespace EnvelopeGenerator.Domain.Interfaces
|
namespace EnvelopeGenerator.Domain.Interfaces
|
||||||
#if NET
|
|
||||||
;
|
|
||||||
#elif NETFRAMEWORK
|
|
||||||
{
|
{
|
||||||
#endif
|
|
||||||
|
|
||||||
public interface IHasReceiver
|
public interface IHasReceiver
|
||||||
{
|
{
|
||||||
#if NET
|
|
||||||
public
|
|
||||||
#endif
|
|
||||||
Entities.Receiver
|
Entities.Receiver
|
||||||
#if NET
|
#if nullable
|
||||||
?
|
?
|
||||||
#endif
|
#endif
|
||||||
Receiver { get; set; }
|
Receiver { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
#if NETFRAMEWORK
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
Reference in New Issue
Block a user