In MVC5, how can I use a "folder" as parameter for Index?
I have this controller method:
public class HookController : Controller
{
[HttpGet]
[Route("hook/{pattern}")]
public ActionResult Index(string pattern)
{
}
}
I can currently call it like this: /hook/?pattern=testpattern
..but I'd like pattern
to be populated when I call /hook/testpattern
as a folder/path.
I thought I could do it with [Route("hook/{pattern}")]
but that has no effect and I just get 404 not found.