I have query parameters such as /api/items?sizes=m,l,xxl
, meaning they are separated by commas. I want to accept them as array of strings ([FromQuery] string[] sizes
).
How do I do that? I know how to split the string, the issue is how do I accept string[]
and let make sure it knows how to split the string?
string[] sizes = request.Sizes.Split(",", StringSplitOptions.RemoveEmptyEntries);