Relative Content

Tag Archive for c#json.netsystem.text.json

Migration from Newtonsoft.Json to System.text.Json

I have some C# reflection code module that is passed in a C# Object that contains dynamic properties. The module looks for properties in the object and if found, calls them passing in json data tailored for the property.

System.Text.Json ecapes single quotes by design

I know that System.Text.Json escapes single quotes by design, but the examples for how to allow certain characters to not be escaped from MS Docs (https://learn.microsoft.com/en-us/dotnet/standard/serialization/system-text-json/character-encoding#serialize-specific-characters)doesn’t work for me as I want to keep single quotes in my serialized JSON.