asp.net-mvc - .Net Core 3.1 中的 AsyncControllerActionInvoker 等效项
问题描述
我一直在尝试将一个项目从 MVC 迁移到 Core 3.1 并且有点卡住了。
类(在 mvc 中)使用AsyncControllerActionInvoker
并覆盖该InvokeAction
方法。由于这在 netcore 3.1 中不兼容,有没有办法在 netcore 3.1 中复制这种模式?
下面是示例代码:
public class ActionInvoker : AsyncControllerActionInvoker
{
public override bool InvokeAction(ControllerContext controllerContext, string actionName)
{
this.InvokeActionWithActionResult(controllerContext, actionName);
// This custom function calls other methods in the controller such as BeginInvokeActionMethodWithFilters and EndInvokeActionMethodWithFilters
return true;
}
}
解决方案
推荐阅读
- javascript - 为什么我的函数总是返回一个未定义的对象?Java 脚本 / 节点 JS
- angular - 如何在变量中应用'"'?
- python - 训练facenet时出现ValueError
- bazel - 如何使 sh_test 依赖于构建 docker 镜像?
- python - 如何计算累积平均收入?Python
- angular - 如何在 Angular 9/TypeScript 中添加垂直滚动条
- firebase - firebase 多区域的优势
- python - 保存的模型无法加载包含自定义方法的层
- javascript - .getValues 无法读取自定义函数
- logstash - ElasticStack 中的架构 logstash 配置文件