I have a service that will return top N items in sales given a bunch of different criteria. So if I have a GET route, how do I set the route to handle an array of a certain parameter?
Top 100 items for group A,C,D,E,F for the current week. Top 100 items for store 1,10,11,18,40 for the current month.
How could the route be structured to handle this?
Its already wired up for you. For the groups example the route declaration will look like this:
Items/{Groups}
The Items DTO will need this property
public string[] Groups { get; set; }
Then you can just call it like so /Items/A,C,D,E,F
The array will get populated correctly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With