Relative Content

Tag Archive for c#json.net

Problem serializing json string to object – not all data from string is mapped

By calling a SAP Business One API endpoint I’m getting all the stock adjustments that were made in our warehouse. The response from the SAP endpoint contains all the data I need but when I deserialize this data to an object with the help of JSONConvert not all the data is returned.
Does anybody recognizes this Problem?

Create a DataTable from a Json reading nested arrays and only the relevant properties

I need to create a DataTable using .NET to read a Json and get the values that we pass the path in as parameter to the app, including nested values, and that DataTable need to have as many rows as values the Json has, so if the Json has an one property with an array of 3 items, then it has to insert 3 rows into the DataTable with the same values except for this property.