I have created the following ActionMethod as suggested here:
[Route("[action]")]
public IActionResult Orders([FromRoute] int[] filterby)
{
ICollection<Order> all;
if(filterby.Length != 0)
{
all = _db.Orders.Where(s => filterby.Contains((int)s.Status)).ToList();
}
else
{
all = _db.Orders.ToList();
}
return View(all);
}
When the request URI is something like:
http://localhost:5000/admin/orders?filterby=0&filterby=1
The filterby parameter is always an array of 0 length. What can't I get it working?