EasyCaching icon indicating copy to clipboard operation
EasyCaching copied to clipboard

EasyCaching.Serialization.SystemTextJson 1.6.1 里的EasyCachingJsonSerializerOptions 属性都是只读的,无法设置值

Open DeliciousExtra opened this issue 1 year ago • 2 comments

Description

EasyCaching.Serialization.SystemTextJson 1.6.1 里的EasyCachingJsonSerializerOptions 属性都是只读的,无法设置值

Steps to Reproduce

  1. option.WithSystemTextJson((EasyCachingJsonSerializerOptions opt) => { },"Json");
  2. the EasyCachingJsonSerializerOptions all properties are readonly,can`t set value;

DeliciousExtra avatar Aug 22 '22 02:08 DeliciousExtra

@DeliciousExtra Thanks for your interest in this project.

The properties of EasyCachingJsonSerializerOptions was designed to readonly.

You should use WithSystemTextJson(this EasyCachingOptions options, Action<JsonSerializerOptions> jsonSerializerSettingsConfigure, string name) to replace.

catcherwong avatar Aug 22 '22 03:08 catcherwong

I didnt find the usage in the document, thx for your reply,its very helpful

DeliciousExtra avatar Aug 22 '22 06:08 DeliciousExtra