Working with the return json data #1721
-
I will preface this with "I am an extreme newbe" coming from VB and local datasets using ODBC connections. My question is, in DAB the data is contained in the values array. Whereas in most rest examples I see, it is not. So using the C# lets say how do I get the returned array into an array variable inside of C#? Can you provide me an eaxmple. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @BumpaRoy, |
Beta Was this translation helpful? Give feedback.
Hi @BumpaRoy,
Thank you for your question!
You can define a class that represents the response (e.g.
ResponseData
) withvalue
as an array of objects property. Then deserialize the response from DAB into an object of theResponseData
class from which you can then access thevalue
property.Example of deserialization is here: https://learn.microsoft.com/en-us/dotnet/standard/serialization/system-text-json/how-to?pivots=dotnet-8-0#deserialize-from-utf-8 where you can replace the
WeatherForecast
class with yourResponseData
class.