Solution 1:
The default model binder expects this url:
http://localhost:4200/api/hoursRange=1&hoursRange=2&hoursRange=3
Only work for this type of method:
[HttpGet]
[Route("api")]
public IActionResult Get([FromQuery]int[] HoursRange)
{
// action
}
Solution 2:
to do that but in different method but in asp.net mvc
Need to change method name like this
http://localhost:54119/api/MultipleData?ids=24041&ids=24117
in order to successfully bind to:
[HttpGet]
[Route("api")]
public ActionResult MultipleData(int[] ids)
{
...
}
Solution 3:
For another verified solution check link
Solution 4:
indexer is also one way to do but not an efficient way
http://localhost:4200/api/hoursRange[0]=24041&hoursRange[1]=24117&hoursRange[2]=24117
Informations
Please check for more customization
customizing-query-string-parameter-binding-in-asp-net-core-mvc