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.
38 lines
869 B
C#
38 lines
869 B
C#
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
namespace DigitalData.UserManager.Domain.Entities
|
|
{
|
|
[Table("TBDD_GROUPS_USER", Schema = "dbo")]
|
|
public class GroupOfUser : BaseEntity
|
|
{
|
|
[Required]
|
|
[Column("USER_ID")]
|
|
public int UserId { get; set; }
|
|
|
|
[Required]
|
|
[Column("GROUP_ID")]
|
|
public int GroupId { get; set; }
|
|
|
|
[StringLength(200)]
|
|
public string
|
|
#if NET7_0_OR_GREATER
|
|
?
|
|
#endif
|
|
Comment { get; set; }
|
|
|
|
[ForeignKey("UserId")]
|
|
public virtual User
|
|
#if NET7_0_OR_GREATER
|
|
?
|
|
#endif
|
|
User { get; set; }
|
|
|
|
[ForeignKey("GroupId")]
|
|
public virtual Group
|
|
#if NET7_0_OR_GREATER
|
|
?
|
|
#endif
|
|
Group { get; set; }
|
|
}
|
|
} |