Im trying to parse in C# using Newtonsoft.Json JSON to anonymous type to use its fields with reflection. But in any ways I get JObject
. In runtime it turns out not at all what I need:
What should I use to get anonymous type object from JSON parsing, like when I use dynamic cleanDynamic = new { SomeProperty = "SomeValue" };
?
Only one similar way I found: JsonConvert.DeserializeAnonymousType(json1, definition)
, but I can't provide definition, I don't know it!
Maybe I have to use another lib? I'm using .net core 2.2.