The driving force behind the MVC architecture is the controller. It returns the appropriate view and model for a request, but that is not the end of the story. In ASP.NET MVC, the controller is much more powerful. I will go deep into the infrastructure of the controller. You will discover that there is much more to this powerful framework than is shown in typical examples, and you will be able to use this knowledge for business scenarios that go beyond serving simple web pages.
28. Breaking It Up Presentation Layer Crosscutting Concerns Controller View ViewModel Business Layer Model Workflow Component Data Access Layer DAL Component Gateway
29. DEMO Moving to a tier Without affecting your Controller!!!
37. Action Results Controllers do something when called Standard action results ViewResult JsonResult ContentResult EmptyResult FileResult HttpUnauthorizedResult
38. Action Results More Standard actions JavaScriptResult RedirectResult RedirectToRouteResult Make your own!
40. Standard Controllers Great for standard web applications Convention-based Even non-standard controllers are convention based when used with views
41. Custom Controllers Can decorate the standard class Can inherit from ControllerBase Can implement IController Use for non-standard applications or for more control
43. Controller as a Service MVC apps are typically web sites They can also be web services Do you have a mixed site/service? It can also be a pure service without JSON
The title of this demo is actually funny to me. Controllers are already services. A request comes in, it is routed to the appropriate action on a controller, and a response is sent back out. Controllers are services that typically respond with information to be rendered in a browser.