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,15 +2,10 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace EnvelopeGenerator.Domain.Entities
|
||||
#if NET
|
||||
;
|
||||
#elif NETFRAMEWORK
|
||||
{
|
||||
#endif
|
||||
|
||||
[Table("TBSIG_CONFIG", Schema = "dbo")]
|
||||
public class Config
|
||||
{
|
||||
[Table("TBSIG_CONFIG", Schema = "dbo")]
|
||||
public class Config
|
||||
{
|
||||
[Column("SENDING_PROFILE", TypeName = "int")]
|
||||
[Required]
|
||||
public int SendingProfile { get; set; }
|
||||
@@ -24,8 +19,5 @@ public class Config
|
||||
|
||||
[Column("EXPORT_PATH", TypeName = "nvarchar(256)")]
|
||||
public string ExportPath { get; set; }
|
||||
}
|
||||
|
||||
#if NETFRAMEWORK
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -9,15 +9,10 @@ using System.Linq;
|
||||
#endif
|
||||
|
||||
namespace EnvelopeGenerator.Domain.Entities
|
||||
#if NET
|
||||
;
|
||||
#elif NETFRAMEWORK
|
||||
{
|
||||
#endif
|
||||
|
||||
[Table("TBSIG_ENVELOPE_DOCUMENT", Schema = "dbo")]
|
||||
public class Document : IHasEnvelope, IHasAddedWhen
|
||||
{
|
||||
[Table("TBSIG_ENVELOPE_DOCUMENT", Schema = "dbo")]
|
||||
public class Document : IHasEnvelope, IHasAddedWhen
|
||||
{
|
||||
public Document()
|
||||
{
|
||||
#if NETFRAMEWORK
|
||||
@@ -86,8 +81,5 @@ public class Document : IHasEnvelope, IHasAddedWhen
|
||||
[NotMapped]
|
||||
public int PageCount { get; set; }
|
||||
#endif
|
||||
}
|
||||
|
||||
#if NETFRAMEWORK
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -4,19 +4,11 @@ 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
|
||||
{
|
||||
[Table("TBSIG_DOCUMENT_STATUS", Schema = "dbo")]
|
||||
public class DocumentStatus : IHasEnvelope, IHasReceiver, IEntity, IHasAddedWhen, IHasChangedWhen
|
||||
{
|
||||
public DocumentStatus()
|
||||
{
|
||||
// TODO: * check Form Application and remove default value
|
||||
@@ -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
|
||||
}
|
||||
@@ -6,15 +6,10 @@ 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
|
||||
{
|
||||
[Table("TBSIG_DOCUMENT_RECEIVER_ELEMENT_ANNOTATION")]
|
||||
public class ElementAnnotation : IHasAddedWhen, IHasChangedWhen, IHasChangedWho
|
||||
{
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
[Column("GUID", TypeName = "bigint")]
|
||||
@@ -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; }
|
||||
@@ -86,8 +81,5 @@ public class ElementAnnotation : IHasAddedWhen, IHasChangedWhen, IHasChangedWho
|
||||
?
|
||||
#endif
|
||||
Element { get; set; }
|
||||
}
|
||||
|
||||
#if NETFRAMEWORK
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -4,19 +4,12 @@ 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
|
||||
{
|
||||
[Table("TBSIG_EMAIL_TEMPLATE", Schema = "dbo")]
|
||||
public class EmailTemplate : IEntity, IHasAddedWhen, IHasChangedWhen
|
||||
{
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
[Column("GUID")]
|
||||
@@ -38,8 +31,5 @@ public class EmailTemplate : IEntity, IHasAddedWhen, IHasChangedWhen
|
||||
|
||||
[Column("CHANGED_WHEN", TypeName = "datetime")]
|
||||
public DateTime? ChangedWhen { get; set; }
|
||||
}
|
||||
|
||||
#if NETFRAMEWORK
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -4,19 +4,11 @@ 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
|
||||
{
|
||||
[Table("TBSIG_ENVELOPE_RECEIVER", Schema = "dbo")]
|
||||
public class EnvelopeReceiver : IHasEnvelope, IHasReceiver, IEntity, IHasAddedWhen, IHasChangedWhen
|
||||
{
|
||||
public EnvelopeReceiver()
|
||||
{
|
||||
#if NETFRAMEWORK
|
||||
@@ -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
|
||||
}
|
||||
@@ -7,15 +7,10 @@ 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
|
||||
{
|
||||
[Table("TBSIG_ENVELOPE_HISTORY", Schema = "dbo")]
|
||||
public class History : IHasEnvelope, IHasReceiver, IEntity, IHasAddedWhen, IHasChangedWhen
|
||||
{
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
[Column("GUID")]
|
||||
@@ -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; }
|
||||
@@ -73,8 +68,5 @@ public class History : IHasEnvelope, IHasReceiver, IEntity, IHasAddedWhen, IHasC
|
||||
[NotMapped]
|
||||
public string StatusTranslated => My.Resources.Model.ResourceManager.GetString(Status.ToString());
|
||||
#endif
|
||||
}
|
||||
|
||||
#if NETFRAMEWORK
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -1,22 +1,11 @@
|
||||
namespace EnvelopeGenerator.Domain.Interfaces
|
||||
#if NET
|
||||
;
|
||||
#elif NETFRAMEWORK
|
||||
{
|
||||
#endif
|
||||
|
||||
public interface IHasEnvelope
|
||||
{
|
||||
#if NET
|
||||
public
|
||||
#endif
|
||||
public interface IHasEnvelope
|
||||
{
|
||||
Entities.Envelope
|
||||
#if NET
|
||||
#if nullable
|
||||
?
|
||||
#endif
|
||||
Envelope { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
#if NETFRAMEWORK
|
||||
}
|
||||
#endif
|
||||
@@ -1,22 +1,11 @@
|
||||
namespace EnvelopeGenerator.Domain.Interfaces
|
||||
#if NET
|
||||
;
|
||||
#elif NETFRAMEWORK
|
||||
{
|
||||
public interface IHasReceiver
|
||||
{
|
||||
#endif
|
||||
|
||||
public interface IHasReceiver
|
||||
{
|
||||
#if NET
|
||||
public
|
||||
#endif
|
||||
Entities.Receiver
|
||||
#if NET
|
||||
#if nullable
|
||||
?
|
||||
#endif
|
||||
Receiver { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
#if NETFRAMEWORK
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user