You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to type this as a Collection of Collections containing DTOs. I tried:
Collection<int, Collection<int, SomeDto>>
But this doesn't work. What's the correct way to type nested Collections like this? Should I be using a different approach or is there a specific syntax for nested generic types that I'm missing?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! I'm working with an API response that has a nested array structure and I'm having trouble with proper typing using Collections.
The response structure looks like this:
{ "standings": [ [ { "id": 1 }, { "id": 2 } ], [ { "id": 3 }, { "id": 4 } ] ] }
I want to type this as a Collection of Collections containing DTOs. I tried:
Collection<int, Collection<int, SomeDto>>
But this doesn't work. What's the correct way to type nested Collections like this? Should I be using a different approach or is there a specific syntax for nested generic types that I'm missing?
Thanks for any guidance!
Beta Was this translation helpful? Give feedback.
All reactions