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

@@ -2,8 +2,6 @@
<PropertyGroup>
<TargetFrameworks>net462;net7.0;net8.0;net9.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageId>UserManager.Domain</PackageId>
<Version>3.1.0</Version>
<Authors>Digital Data GmbH</Authors>
@@ -19,11 +17,13 @@
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net462'">
<Nullable>disable</Nullable>
<ImplicitUsings>disable</ImplicitUsings>
<LangVersion>7.3</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' != 'net462'">
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>latest</LangVersion>
</PropertyGroup>