asp.net help page does not show right routes

34 views Asked by At

I am using attribute routes to route actions in controllers, but asp.net generate wrong Help Page

[HttpGet]
[Route("getAll")]
[AllowAnonymous]
public IHttpActionResult GetCategories(){...}

But the result is enter image description here

1

There are 1 answers

0
Petre T On

Set up your config to use attribute routing.

public static class WebApiConfig
{
    public static void Configure(HttpConfiguration configuration)
    {
        //the following config sets up your routing mechanism to use attributes
        configuration.MapHttpAttributeRoutes();
    }
}