Question

I am trying to display the Help page in WebApi, by displaying the URL and corresponding parameters.

By using the following command in "Package Manager Console" I am able to generate Help page with basic GET, POST, PUT, DELETE verbs (it using the simple operations).

 PM> Install-Package Microsoft.AspNet.WebApi.HelpPage

I done this using the following explanary link: http://www.asp.net/web-api/overview/creating-web-apis/creating-api-help-pages and it is showing URL help like this : " GET api/Values "

But in my application I am using the "Attribute Route" Concept for accessing URL in the service, like:

       [ActionName("TestGet")]
        [Route("TestApi/TestGet/{Value}")]
        public string TestGetting(int Value)
        {
            return Value.ToString();
        }

for showing the attribute Route URL in help page automatically, like :" Get TestApi/TestGet/{Value} "

What should I have to do?

Please suggest the better answer/links to show the help Content dynamically.

Was it helpful?

Solution

Like Kiran says, this should just work if you enabled attribute routing. Can you hit your action?

You should also remove the ActionName attribute as it's meaningless when you use attribute routing.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top