ASP.NET MVC 中的脚手架控制器
对于 ASP.NET MVC(v2 和 v3 RC)中的脚手架控制器,我们有哪些选项?我了解代码模板文件夹和 T4,但它只允许创建一个 .tt 文件,因此,用您自己的模板替换默认控制器模板,但我需要的是针对各种类型的控制器的不同类型的模板。
我听说 Rails 对此给予大力支持。我还知道 MVC 3 中的 MvcScaffold 包(通过 NuGet)由 Scott Hanselman 开发,支持 ControllerWithContext 和 ControllerWithRepository,但我想更进一步,因为源代码尚未发布(至少我不知道),所以我无法对其进行太多自定义。
大家都用什么或者做什么?
What options do we have for scaffolding controllers in ASP.NET MVC (v2 and v3 RC)? I know about the code templates folder and T4 but it only allows creating one .tt file and thus, replacing the default controller template with your own but what I would need is different types of templates for various types of controllers.
I've heard that Rails has huge support for this. I'm also aware of the MvcScaffold package in MVC 3 (via NuGet) as described and developed by Scott Hanselman which supports ControllerWithContext and ControllerWithRepository but I would like to take this further and since the source code hasn't been published (at least I'm not aware of it) there isn't much I can do to customize it.
What do you guys use or do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有 通用控制器 (
控制器
)技术。大粉丝。There is the Generic Controller (
Controller<T>
) technique. Big fan.