Thursday, November 1, 2012

MvcPages: ASP.NET MVC without routes and controllers

I like developing with ASP.NET MVC, but sometimes I feel there are too many pieces involved. To develop a single function you have to (in no particular order):
  • Create route (make sure it doesn't break other routes)
  • Create controller/action
  • Create view model
  • Create view
... in addition to writing the model/service that does the actual work. Even though this layering gives you a lot of flexibility and testability, sometimes you don't need it. Do you really need all of the above to develop a simple contact form? Do you ever test your controllers/views? Do you have a lot of actions that just return View()?