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

@@ -6,23 +6,23 @@ using System.Text.Json.Serialization;
namespace EnvelopeGenerator.Domain.Entities
{
[Table("TBSIG_CONFIG", Schema = "dbo")]
public class Config : IUnique<int>
public class Config
{
[Column("DOCUMENT_PATH", TypeName = "nvarchar(256)")]
public string? DocumentPath { get; init; }
public string DocumentPath { get; set; }
[Column("SENDING_PROFILE", TypeName = "int")]
[Required]
public required int SendingProfile { get; init; }
public int SendingProfile { get; set; }
[Column("SIGNATURE_HOST", TypeName = "nvarchar(128)")]
public string? SignatureHost { get; init; }
public string SignatureHost { get; set; }
[Column("EXTERNAL_PROGRAM_NAME", TypeName = "nvarchar(30)")]
public string? ExternalProgramName { get; init; }
public string ExternalProgramName { get; set; }
[Column("EXPORT_PATH", TypeName = "nvarchar(256)")]
public string? ExportPath { get; init; }
public string ExportPath { get; set; }
[Obsolete("Configuration does not have an ID; it represents a single table in the database.")]
[NotMapped]