⬆️ Upgrade the dotnet framework to 10.0

This commit is contained in:
2025-11-14 22:11:16 +08:00
parent 1647aa2f1e
commit bd2943345a
12 changed files with 23 additions and 28 deletions

View File

@@ -234,11 +234,9 @@ public class CacheServiceRedis : ICacheService
var value = await _database.StringGetAsync(key);
if (value.IsNullOrEmpty)
return default;
// For NodaTime serialization, use the configured JSON options
return JsonSerializer.Deserialize<T>(value!, _jsonOptions);
return value.IsNullOrEmpty ? default :
// For NodaTime serialization, use the configured JSON options
JsonSerializer.Deserialize<T>(value.ToString(), _jsonOptions);
}
public async Task<(bool found, T? value)> GetAsyncWithStatus<T>(string key)
@@ -249,11 +247,9 @@ public class CacheServiceRedis : ICacheService
var value = await _database.StringGetAsync(key);
if (value.IsNullOrEmpty)
return (false, default);
// For NodaTime serialization, use the configured JSON options
return (true, JsonSerializer.Deserialize<T>(value!, _jsonOptions));
return value.IsNullOrEmpty ? (false, default) :
// For NodaTime serialization, use the configured JSON options
(true, JsonSerializer.Deserialize<T>(value!.ToString(), _jsonOptions));
}
public async Task<bool> RemoveAsync(string key)

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
@@ -32,7 +32,6 @@
<PackageReference Include="Otp.NET" Version="1.4.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="9.0.6" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="9.0.6" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
<PackageReference Include="Yarp.ReverseProxy" Version="2.3.0" />
<PackageReference Include="Aspire.NATS.Net" Version="9.5.2" />