RESTful API (JSON)
This content can be purchased as part of the following courses:
SIMPL# – Fundamentals CourseCourse DetailsAdd to Cart |
Leave a CommentComments- 2021-10-29 19:22:55That would depend on what the array looked like. If you just have an array of values then you still need a key as part of the KeyValuePair. If you have a JSON array of JSON objects then from within the object you need to determine what the key and value should be. In some cases you would need a custom JsonConverter.
- 2021-03-28 08:08:09Hi Troy,
I am looking for a way to deserialize a JSON return with array type into a list of KeyValuePair.
Following some online resources I am able to deserialize array elements into a List > public List student { get; set; }
Can I do something like:
public List> student { get; set; }
So that I could have access to a particular student without looping through the whole list?
- 2021-10-29 19:22:55That would depend on what the array looked like. If you just have an array of values then you still need a key as part of the KeyValuePair. If you have a JSON array of JSON objects then from within the object you need to determine what the key and value should be. In some cases you would need a custom JsonConverter.
- 2021-03-28 08:08:09Hi Troy, I am looking for a way to deserialize a JSON return with array type into a list of KeyValuePair. Following some online resources I am able to deserialize array elements into a List > public List student { get; set; } Can I do something like: public List> student { get; set; } So that I could have access to a particular student without looping through the whole list?