Answer the question
In order to leave comments, you need to log in
How to selectively deserialize JSON?
There is a problem with deserializing complex Json files. I just can't understand how I can pull out an arbitrary value from a complex structure and work with it normally. For example, take a list of all "messages" (just them), and then access the rest of the values in the style "message.from.lastname".
The "JsonConvert.DeserializeObject<>()" method converts everything at once and does not allow you to work correctly directly with values.
On the Internet, I did not find parsing of complex structures, only simple json.
According to the dynamyc-type, I didn’t understand how it works at all. Some kind of magic.
Answer the question
In order to leave comments, you need to log in
I don’t see any point in parsing partially, but if you really want to:
JsonDocument
Utf8JsonReader
And here’s how to use them:
https://docs.microsoft.com/en-us/dotnet/standard/s...
Don’t even look at dynamic, it’s support from System.Text.Json was cut out
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question