diff --git a/framework/src/Volo.Abp.Json/Volo/Abp/Json/SystemTextJson/AbpSystemTextJsonSerializerProvider.cs b/framework/src/Volo.Abp.Json/Volo/Abp/Json/SystemTextJson/AbpSystemTextJsonSerializerProvider.cs index 0af3f8e572..802dd3f528 100644 --- a/framework/src/Volo.Abp.Json/Volo/Abp/Json/SystemTextJson/AbpSystemTextJsonSerializerProvider.cs +++ b/framework/src/Volo.Abp.Json/Volo/Abp/Json/SystemTextJson/AbpSystemTextJsonSerializerProvider.cs @@ -40,11 +40,16 @@ public class AbpSystemTextJsonSerializerProvider : IJsonSerializerProvider, ITra return JsonSerializer.Deserialize(jsonString, type, CreateJsonSerializerOptions(camelCase)); } - private readonly static ConcurrentDictionary JsonSerializerOptionsCache = new ConcurrentDictionary(); + private readonly static ConcurrentDictionary JsonSerializerOptionsCache = new ConcurrentDictionary(); protected virtual JsonSerializerOptions CreateJsonSerializerOptions(bool camelCase = true, bool indented = false) { - return JsonSerializerOptionsCache.GetOrAdd($"default{camelCase}{indented}", _ => + return JsonSerializerOptionsCache.GetOrAdd(new + { + camelCase, + indented, + Options.JsonSerializerOptions + }, _ => { var settings = new JsonSerializerOptions(Options.JsonSerializerOptions);