❔ Get only values when deserialize json
Hi, it's possible to deserialize something like this with only values?
I would like something like this instead of a
Dictionary
:
12 Replies
How do you want this to work?
Why wouldn't you just deserialize then convert it to list?
I'm building an api wrapper.
So I just use
And I add some method to get a list?
It's not clear how you want to get a list from this because the json is a dictionary
You have
"Fantasy": "Fantastique"
which isn't obvious how it should become an element in a list.Yes but I only need the values.
Then deserialize into a dictionary and use the
Values
of the dictionary.Something like this?
yeah
Although personally I'd use
IReadOnlyCollection<string>
and not List<string>
I would like to deserialize _Genres with a private visibility because the users of the lib doesn't need to use _Genres. It's possible?
Why not
IEnumerable<string>
?Wouldn't a DTO to contract map be better in this situation?
might be
Corrected myself, having a count is probably beneficial
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.