简体   繁体   English

Web Api帮助页面 - 仅显示某些控制器但不显示其他控制器

[英]Web Api Help Page - Show only some controllers but no others

I've an application made in Web Api 2.1 (Visual Studio 2012 C#) and I made a Help page with XML Documentation. 我在Web Api 2.1(Visual Studio 2012 C#)中创建了一个应用程序,并使用XML文档创建了一个帮助页面。

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. 我只想暴露一些控制器,而不是我的Web Api的所有控制器,但同时我不想从方法,类,属性等中删除注释。

How can I select some elements and others not to show in my help? 如何在我的帮助中选择一些不显示的元素和其他元素?

Thanks in advance 提前致谢

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: 对于您希望从自动生成的帮助页面中排除的每个API控制器,您应该将以下属性添加到控制器:

 [ApiExplorerSettings(IgnoreApi = true)]  


PS You have to include the following using statement: PS您必须包含以下using语句:

System.Web.Http.Description

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM