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.
47 lines
1.1 KiB
C#
47 lines
1.1 KiB
C#
using System.ComponentModel;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
#if NETFRAMEWORK
|
|
using System;
|
|
#endif
|
|
|
|
namespace DigitalData.UserManager.Domain.Entities
|
|
{
|
|
[Table("TBDD_CLIENT_USER", Schema = "dbo")]
|
|
public class ClientUser
|
|
{
|
|
[Column("GUID")]
|
|
[Key]
|
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
|
public int Id { get; set; }
|
|
|
|
[Required]
|
|
[Column("USER_ID")]
|
|
public int UserId { get; set; }
|
|
|
|
[Required]
|
|
[Column("CLIENT_ID")]
|
|
public int ClientId { get; set; }
|
|
|
|
[Column("COMMENT")]
|
|
public string
|
|
#if NET7_0_OR_GREATER
|
|
?
|
|
#endif
|
|
Comment
|
|
{ get; set; }
|
|
|
|
[StringLength(50)]
|
|
[Column("ADDED_WHO")]
|
|
public string
|
|
#if NET7_0_OR_GREATER
|
|
?
|
|
#endif
|
|
AddedWho
|
|
{ get; set; }
|
|
|
|
[Column("ADDED_WHEN", TypeName = "datetime")]
|
|
[DefaultValue("GETDATE()")]
|
|
public DateTime AddedWhen { get; set; } = DateTime.Now;
|
|
}
|
|
} |