开发者

Scaffolding controllers in ASP.NET MVC

开发者 https://www.devze.com 2023-01-28 05:44 出处:网络
What op开发者_如何学Ctions 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, replac

What op开发者_如何学Ctions 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?


There is the Generic Controller (Controller<T>) technique. Big fan.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号