Is it possible in ASP.NET to have a RoutePrefix attribute on an ApiController that contains a route parameter?
[RoutePrefix("api/parent/{pid}/child")]
public class ChildController : ApiController
{
[Route("")]
public HttpResponseMessage Get(object pid)
{
//...
}
[Route("{cid}"]
public HttpResponseMessage Get(object pid, object cid)
{
//...
}
}
I would like to have the pid parameter accessible to all controller methods.