TekH bc44de63ee Update project for multi-targeting and nullable types
Updated `DigitalData.UserManager.Domain.csproj` to support .NET 4.6.2, 7.0, 8.0, and 9.0. Adjusted implicit usings and nullable reference types settings based on the target framework, disabling nullable types for `net462` and enabling them for others.

Refactored entity classes (`BaseEntity`, `ClientUser`, `Group`, `GroupOfUser`, `Module`, `ModuleOfUser`, `User`, and `UserRep`) to conditionally include nullable reference types. Added `?` operator for string properties in .NET 7.0 and above, enhancing code safety and reducing null reference exceptions.
2025-06-26 13:15:36 +02:00

76 lines
1.7 KiB
C#

using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace DigitalData.UserManager.Domain.Entities
{
[Table("TBDD_USER_MODULES", Schema = "dbo")]
public class ModuleOfUser
{
[Column("GUID")]
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; set; }
[Column("USER_ID")]
[Required]
public int UserId { get; set; }
[Column("MODULE_ID")]
[Required]
public int ModuleId { get; set; }
[Column("COMMENT")]
[StringLength(200)]
public string
#if NET7_0_OR_GREATER
?
#endif
Comment { get; set; }
[Column("ADDED_WHO")]
[StringLength(50)]
public string
#if NET7_0_OR_GREATER
?
#endif
AddedWho { get; set; } = "DEFAULT";
[Column("CHANGED_WHO")]
[StringLength(50)]
public string
#if NET7_0_OR_GREATER
?
#endif
ChangedWho { get; set; }
[ForeignKey("UserId")]
public virtual User
#if NET7_0_OR_GREATER
?
#endif
User { get; set; }
[ForeignKey("ModuleId")]
public virtual Module
#if NET7_0_OR_GREATER
?
#endif
Module { get; set; }
#region IGNORED COLUMNS
//public bool IsAdmin { get; set; }
//public bool Right1 { get; set; }
//public bool Right2 { get; set; }
//public bool Right3 { get; set; }
//public bool Right4 { get; set; }
//public DateTime? AddedWhen { get; set; }
//public DateTime? ChangedWhen { get; set; }
#endregion
}
}