You can write better controllers by adhering to the best practices. So-called “thin” controllers—i.e. controllers with less code and fewer responsibilities—are easier to read and maintain. And once ...
Take advantage of filters to execute custom code at specific points in the request processing pipeline and avoid code duplication across actions. Filters allow you to run code at certain stages of the ...
[Editor's note: Peter rewrote this article after a reader pointed out he over-engineered his original solution. ("What can I say: The code worked -- I just didn't need nearly as much code as I thought ...