🐛 Replace the serializer in cache service with newtonsoft json to solve JsonIgnore issue

This commit is contained in:
2025-05-24 18:29:20 +08:00
parent 460ce62452
commit 445e5d3705
7 changed files with 117 additions and 108 deletions

View File

@ -45,13 +45,12 @@ builder.WebHost.ConfigureKestrel(options => options.Limits.MaxRequestBodySize =
builder.Services.AddLocalization(options => options.ResourcesPath = "Resources");
builder.Services.AddDbContext<AppDatabase>();
builder.Services.AddSingleton<IConnectionMultiplexer>(sp =>
builder.Services.AddSingleton<IConnectionMultiplexer>(_ =>
{
var connection = builder.Configuration.GetConnectionString("FastRetrieve")!;
return ConnectionMultiplexer.Connect(connection);
});
builder.Services.AddScoped<ICacheService, CacheServiceRedis>();
builder.Services.AddSingleton<ICacheService, CacheServiceRedis>();
builder.Services.AddHttpClient();
builder.Services.AddControllers().AddJsonOptions(options =>