Say I have an action method:
[HttpGet]
public ActionResult Search(List<int> category){
...
}
The way the MVC model binding works, it expects a list of category like this:
/search?category=1&category=2
So my questions are:
How do I create that link using Url.Action() if I just hardcode it?
Url.Action("Search", new {category=???}) //Expect: /search?category=1&category=2
How do I create that link using Url.Action() if my input is a list of int?
var categories = new List<int>(){1,2}; //Expect: /search?category=1&category=2
Url.Action("Search", new {category=categories}) //does not work,