gpt4 book ai didi

asp.net-mvc - T4MVC 基础 Controller 没有默认构造函数

转载 作者:行者123 更新时间:2023-12-04 18:47:39 25 4
gpt4 key购买 nike

我的 Controller 是从另一个没有默认构造函数的 Controller 继承的。 T4MVC 生成以下构造函数,假设基本 Controller 具有默认构造函数:

protected MyControllerController(Dummy d) { }

我该如何解决这个问题?很有趣,据 this页面,版本 2.4.00“修复了基本 Controller 没有默认构造函数时的问题”。我也 found这个问题,但我的基本 Controller 不是通用的。

最佳答案

如果您使基本 Controller 抽象,这应该可以正常工作。我认为它永远不需要直接用作 Controller ?如果是这样,那么您始终可以创建另一个非抽象派生类来处理它。

关于asp.net-mvc - T4MVC 基础 Controller 没有默认构造函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11584949/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com