Backend software developer passionate about dotnet, C# and Azure
...So, the problem came — how to deserialize a string of json into some c# object, to let serializer understand it properly at the moment of output and provide usable json on API response? All the recommendations that I found from the web were about strongly typed deserealization, but in my case the format of the json in the source string is unknown in advance. It can even be not flat, and properties can have values of any type — number, bool or string. Two options to experiment with came to my mind: anonymous objects or dynamics. I started with the latter and eventually came up with the working solution.
© theyur.dev. All Rights Reserved. Designed by HTML Codex