![]() Imagine we have a JSON object which you're going to use as the body of a HTTP POST request. Generate C for a simple JSON sample echo ' 1, 2, 3.14' quicktype -lang cs Generate C for a sample JSON file. I want the parser to recurse in and deserialise the inner Json to a. Let's start from the begining and go through some really basic examples when it comes to data binding. This is the code I used to deserialize: var json File.ReadAllText ('c:\temp\job.json') var result JsonConvert.DeserializeObject (json) The result is almost correct, but the value of the item with a key of 'JobNotes' is just json string.![]() ![]() The problem I have is basically to fix some weird data structure coming from a data provider, which I'm sure there's some background story on why the structure is that way, into a reasonable structure that I can later on map into a model or entity more easily. In Visual Studio, in the menu at the top, click Edit > Paste special > Paste Json as classes.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |