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:
@@ -28,28 +28,28 @@ namespace DigitalData.UserManager.Domain.Entities
|
||||
|
||||
[ForeignKey("UserId")]
|
||||
public virtual User
|
||||
#if NET6_0_OR_GREATER
|
||||
#if NET7_0_OR_GREATER
|
||||
?
|
||||
#endif
|
||||
User { get; set; }
|
||||
|
||||
[ForeignKey("RepGroupId")]
|
||||
public virtual Group
|
||||
#if NET6_0_OR_GREATER
|
||||
#if NET7_0_OR_GREATER
|
||||
?
|
||||
#endif
|
||||
RepGroup { get; set; }
|
||||
|
||||
[ForeignKey("GroupId")]
|
||||
public virtual Group
|
||||
#if NET6_0_OR_GREATER
|
||||
#if NET7_0_OR_GREATER
|
||||
?
|
||||
#endif
|
||||
Group { get; set; }
|
||||
|
||||
[ForeignKey("RepUserId")]
|
||||
public virtual User
|
||||
#if NET6_0_OR_GREATER
|
||||
#if NET7_0_OR_GREATER
|
||||
?
|
||||
#endif
|
||||
RepUser { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user