Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/csharp-4.0/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 4.0 如何使用GetApiExplorer()获取自定义控制器中的控制器名称和可用数据_C# 4.0_Asp.net Mvc 4_Controller_Asp.net Web Api_Asp.net Mvc Apiexplorer - Fatal编程技术网

C# 4.0 如何使用GetApiExplorer()获取自定义控制器中的控制器名称和可用数据

C# 4.0 如何使用GetApiExplorer()获取自定义控制器中的控制器名称和可用数据,c#-4.0,asp.net-mvc-4,controller,asp.net-web-api,asp.net-mvc-apiexplorer,C# 4.0,Asp.net Mvc 4,Controller,Asp.net Web Api,Asp.net Mvc Apiexplorer,嗨,我有BaseController:ApiController 和TestController:BaseController 如何获取控制器名称和TestController的相关详细信息 使用下面的代码 GlobalConfiguration.Configuration.Services.GetApiExplorer().ApiDescriptions .GroupBy(x => x.ActionDescriptor.ControllerDescriptor.Controlle

嗨,我有
BaseController:ApiController

TestController:BaseController

如何获取控制器名称和TestController的相关详细信息

使用下面的代码

GlobalConfiguration.Configuration.Services.GetApiExplorer().ApiDescriptions
    .GroupBy(x => x.ActionDescriptor.ControllerDescriptor.ControllerName)
    .Select(x => x.First().ActionDescriptor.ControllerDescriptor.ControllerName)
我可以获得
BaseController


如何获取TestController的详细信息(ApiDescriptions)?

我的错误

现在我对
TestController
中的以下代码进行注释。现在一切都很完美

[ApiExplorerSettings(IgnoreApi = true)]

你指的“细节”是什么?@von v:
apiscriptions