What is RESTController?

Find yourself writing the same code over and over in your MVC controllers? What if there was a way to take care of the common operations required in a controller so that all you had to do was wire up the data storage? What if everything was built in an open manner, where everything could be extended, and there were plenty of event hooks for the basic controller lifetime?

RESTController provides this answer.

The basic logic of a RESTController action

  • Notify the action has been requested.
  • If model state is valid, perform some operation.
    • If the request is an AJAX request, return a partial view.
    • Otherwise, return a View.
  • If the model state is not valid, notify the user and return the form.
  • If an exception occurs in that time, notify the user and return the form.

That's a lot of work to do every time you perform an action. The whole point of RESTController is to reduce or eliminate all of that extra work. This is done with lots of extension points inside a controller base class.

Blog Posts about RESTController

Last edited Dec 9, 2010 at 10:54 AM by jarrettmeyer, version 10