如何让 T4 跳过自定义方法的转换?
是否有任何属性或其他方法可以让 T4 跳过尝试转换自定义方法?
它在哪里显示警告说 T4MVC.tt 不支持 MyController.Method 因为它不返回受支持的 ActionResult 类型?
例如:
在具有此方法的 BaseController 上:
public UrlHelper GetUrlHelper()
{
return new UrlHelper(this.ControllerContext.RequestContext);
}
Is there any attribute or other method of getting T4 to skip trying to transform custom methods?
Where it shows a warning saying T4MVC.tt doesn't support MyController.Method because it doesn't return a supported ActionResult type?
For example:
On a BaseController having this method:
public UrlHelper GetUrlHelper()
{
return new UrlHelper(this.ControllerContext.RequestContext);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
啊,是的,我假设您是在 MvcConf 演讲中提出问题的人:)
我认为我们应该更改 T4MVC 以消除此警告,这可能弊大于利。你能尝试在 t4mvc.tt 中去掉它吗?应该在最新版本的 776 行附近。
我可以进行更改,它将在下一个版本 (2.6.22) 中进行,但请告诉我这是否适合您。谢谢!
Ah yes, I assume you're the one who asked during the MvcConf talk :)
I think we should just change T4MVC to just get rid of this warning, which probably does more harm than good. Can you try getting rid of it in t4mvc.tt? Should be around line 776 in the latest build.
I can just make that change and it will go in the next drop (2.6.22), but please let me know if that works well for you. Thanks!