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.
This commit is contained in:
2025-06-26 13:15:36 +02:00
parent b1075c8b82
commit bc44de63ee
9 changed files with 28 additions and 28 deletions

View File

@@ -10,7 +10,7 @@ namespace DigitalData.UserManager.Domain.Entities
[Column("PRENAME")]
[StringLength(50)]
public string
#if NET6_0_OR_GREATER
#if NET7_0_OR_GREATER
?
#endif
Prename { get; set; }
@@ -18,7 +18,7 @@ namespace DigitalData.UserManager.Domain.Entities
[Column("NAME")]
[StringLength(50)]
public string
#if NET6_0_OR_GREATER
#if NET7_0_OR_GREATER
?
#endif
Name { get; set; }
@@ -31,7 +31,7 @@ namespace DigitalData.UserManager.Domain.Entities
[Column("SHORTNAME")]
[StringLength(30)]
public string
#if NET6_0_OR_GREATER
#if NET7_0_OR_GREATER
?
#endif
Shortname
@@ -40,7 +40,7 @@ namespace DigitalData.UserManager.Domain.Entities
[Column("EMAIL")]
[StringLength(100)]
public string
#if NET6_0_OR_GREATER
#if NET7_0_OR_GREATER
?
#endif
Email { get; set; }
@@ -50,7 +50,7 @@ namespace DigitalData.UserManager.Domain.Entities
[StringLength(5)]
[DefaultValue("de-DE")]
public string
#if NET6_0_OR_GREATER
#if NET7_0_OR_GREATER
?
#endif
Language { get; set; }
@@ -58,7 +58,7 @@ namespace DigitalData.UserManager.Domain.Entities
[Column("COMMENT")]
[StringLength(500)]
public string
#if NET6_0_OR_GREATER
#if NET7_0_OR_GREATER
?
#endif
Comment { get; set; }