9

I've an application made in Web Api 2.1 (Visual Studio 2012 C#) and I made a Help page with XML Documentation.

I just want only expose some controllers, not all controllers of my Web Api, but at the same time I don't want to remove the comments from the methods, classes, properties, etc.

How can I select some elements and others not to show in my help?

Thanks in advance

Leandro Bardelli
  • 10,561
  • 15
  • 79
  • 116

1 Answers1

27

For every API controller that you would like to have excluded from the auto generated help pages you should add the following attribute to your controller:

 [ApiExplorerSettings(IgnoreApi = true)]  


P.S. You have to include the following using statement:

System.Web.Http.Description

Curiosity
  • 1,753
  • 3
  • 25
  • 46
mreyeros
  • 4,359
  • 20
  • 24