An ASP.NET 5 MVC controller handles user requests to your site. Recall that the routing engine uses the URL convention to route a request to your controller and on to a method on that controller. For example, a request for
./customer/edit/5 will, by default, route to your
CustomerController.Edit(id) method; the value 5 will be passed as the
The controller method is then responsible for connecting the request to your model and returning the appropriate view result. The
Edit(id) method, for example, will likely use a
DbContext (created in the prior section) to find a specific customer from the database.
The controller would pass the
Customer instance from the model to the Customer/Edit view page and return a ...