⬆️ 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)