I\'ve the following problem, my route attribute is not working.
I have the following action:
[HttpGet]
[Route(\"~api/admin/template/{fileName}\")]
pu
You have to call MapHttpAttributeRoutes()
so that the Framework will be able to walk through your attributes and register the appropriate routes upon application start:
public static class WebApiConfig
{
public static void Register(HttpConfiguration config)
{
config.MapHttpAttributeRoutes();
// you can add manual routes as well
//config.Routes.MapHttpRoute(...
}
}
See MSDN