mare
mare

Reputation: 13083

Scaffolding controllers in ASP.NET MVC

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?

Upvotes: 3

Views: 1303

Answers (1)

John Farrell
John Farrell

Reputation: 24754

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

Upvotes: 3

Related Questions