Refactor entity classes for non-nullable properties

Removed nullable types and `init` properties, replacing them with standard getters and setters in various entity classes. Updated properties like `DocumentPath`, `SendingProfile`, and `SignatureHost` to be non-nullable and added required attributes.

Modified the project file to include `net462` as a target framework and added a reference for `System.ComponentModel.Annotations`. Removed the `IUnique<int>` interface from several classes to simplify uniqueness management.

These changes improve data integrity and usability across the entity classes.
This commit is contained in:
Developer 02
2025-05-14 09:16:02 +02:00
parent 83d29bf78d
commit 1a69478f48
15 changed files with 153 additions and 166 deletions

View File

@@ -1,12 +1,10 @@
using DigitalData.Core.Abstractions;
using DigitalData.UserManager.Domain.Entities;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace EnvelopeGenerator.Domain.Entities
{
[Table("TBSIG_ENVELOPE_HISTORY", Schema = "dbo")]
public class EnvelopeHistory : IUnique<long>
public class EnvelopeHistory
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
@@ -19,7 +17,7 @@ namespace EnvelopeGenerator.Domain.Entities
[Required]
[Column("USER_REFERENCE", TypeName = "nvarchar(128)")]
public required string UserReference { get; init; }
public string UserReference { get; set; }
[Required]
[Column("STATUS")]
@@ -31,15 +29,15 @@ namespace EnvelopeGenerator.Domain.Entities
public DateTime AddedWhen { get; set; }
[Column("ACTION_DATE", TypeName = "datetime")]
public DateTime? ActionDate { get; set; }
public DateTime ActionDate { get; set; }
[Column("COMMENT", TypeName = "nvarchar(max)")]
public string? Comment { get; set; }
public string Comment { get; set; }
[ForeignKey("UserReference")]
public virtual User? Sender { get; set; }
public virtual User Sender { get; set; }
[ForeignKey("UserReference")]
public virtual Receiver? Receiver { get; set; }
public virtual Receiver Receiver { get; set; }
}
}