From 06ad3516f1b2301af90b8dfc5a60dff6d4489ad9 Mon Sep 17 00:00:00 2001 From: TekH Date: Thu, 26 Jun 2025 15:45:22 +0200 Subject: [PATCH] Enhance User entity with required properties and updates - Added conditional compilation for .NET Framework. - Made `GeneralViewer`, `WanEnvironment`, and `DeletedWho` properties required with appropriate attributes. - Renamed `UseridFkIntEcm` to `UserIdFkIntEcm` and marked it as required. - Changed `DeletedWhen` to a non-nullable `DateTime`. - Removed previously ignored columns, activating them in the class definition. --- .../Entities/User.cs | 45 +++++++++++-------- 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/DigitalData.UserManager.Domain/Entities/User.cs b/DigitalData.UserManager.Domain/Entities/User.cs index 5487ee3..d77e729 100644 --- a/DigitalData.UserManager.Domain/Entities/User.cs +++ b/DigitalData.UserManager.Domain/Entities/User.cs @@ -1,6 +1,9 @@ using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +#if NETFRAMEWORK +using System; +#endif namespace DigitalData.UserManager.Domain.Entities { @@ -84,27 +87,33 @@ namespace DigitalData.UserManager.Domain.Entities [Column("ACTIVE")] public bool Active { get; set; } - #region IGNORED COLUMNS - //[Required] - //[Column("GENERAL_VIEWER")] - //[StringLength(30)] - //[DefaultValue("NONE")] - //public string GeneralViewer { get; set; } + [Required] + [Column("GENERAL_VIEWER")] + [StringLength(30)] + [DefaultValue("NONE")] + public +#if NET7_0_OR_GREATER + required +#endif + string GeneralViewer { get; set; } - //[Required] - //[Column("WAN_ENVIRONMENT")] - //public bool WanEnvironment { get; set; } + [Required] + [Column("WAN_ENVIRONMENT")] + public bool WanEnvironment { get; set; } - //[Required] - //[Column("USERID_FK_INT_ECM")] - //public int UseridFkIntEcm { get; set; } + [Required] + [Column("USERID_FK_INT_ECM")] + public int UserIdFkIntEcm { get; set; } - //[Column("DELETED_WHEN")] - //public DateTime? DeletedWhen { get; set; } + [Column("DELETED_WHEN")] + public DateTime DeletedWhen { get; set; } - //[Column("DELETED_WHO")] - //[StringLength(50)] - //public string? DeletedWho { get; set; } - #endregion + [Column("DELETED_WHO")] + [StringLength(50)] + public +#if NET7_0_OR_GREATER + required +#endif + string DeletedWho { get; set; } } } \ No newline at end of file