I have the following route mapping or WEB API
[Route("Foo/Id/{id=1}/bar")]
I want to make Id optional as above however from client side no matter what I call it route doesn't match and I get 404 I try things like
Foo/Id//bar
But doesn't work. Is there way to use optional parameters with web api if the parameter is not at the end?
GetFooById(int id = 0)
. Both routes will point to that.