Serializing custom types in a C# ConcurrentDictionary

103 Views Asked by At

With Newtonsoft, I can specify the following attribute on my CurrentDictionary defintion to indicate a custom serializer for my custom class: 'Saturation':

[JsonProperty(PropertyName = "substances", ItemConverterType = typeof(SaturationJsonConverter))]
protected ConcurrentDictionary<string, Saturation> Substances { get; } = new();

Question: How can I mimic this behavior using System.Text.Json?

0

There are 0 best solutions below