views:

21

answers:

1

I am developing the administration part of a site. It mostly consist of manipulating list of data such as:

  • Products
  • Suppliers
  • Tax profiles
  • ...

I find the task of creating a controller that handle the CRUD operations of each model a little too repeating and prone to mistake from one controller to another.

I would still need to adapt some of these controller for additional operation, but not all.

Does someone know an existing library or a proven approach for reducing the implication of controller for the usual CRUD operations?

+1  A: 

One suggestion would be to look at tweaking the T4 template that is used to generate the scaffold methods. Check out Rob Conery's MVC Starter Site to see what he's done (look in /Web/CodeTemplates in the source for the general idea).

There are also some other MVC libraries out there such as FubuMVC that aim to cut down on code repetition, but it's not based on the actual ASP.NET MVC framework (and it's not really my thing).

Jon