小编Fer*_*tch的帖子

AspNetCore.Mvc中的descriptor.ControllerDescriptor.ControllerName

我正在构建一个ASP.NET Core 2.0 Web应用程序.在ASP.NET WEB中我使用了System.Web.Mvc,其中我有以下行来获取ControllerName:

descriptor.ControllerDescriptor.ControllerName
Run Code Online (Sandbox Code Playgroud)

在ASP.NET Core 2.0中,这不起作用我收到错误:

错误CS1061'ActionDescriptor'不包含'ControllerDescriptor'的定义,也没有扩展方法'ControllerDescriptor'接受'ActionDescriptor'类型的第一个参数

在ASP.NET Core 2.0中,我找不到获取ControllerName的替代方法.有没有人有建议?

c# asp.net-core

4
推荐指数
1
解决办法
1807
查看次数

标签 统计

asp.net-core ×1

c# ×1