Controllers in ASP.NET

Learn about controller classes and their action methods in ASP.NET Core.

Controller classes are where your application logic resides. At the end of this lesson, the entire controller is written in the code widget. Look at the code line by line to figure out how it is functioning.

Controller inheritance

public class UsersController : Controller

ASP.NET requires every controller class to implement the IController interface. The Controller class implements that interface while also providing you support for views. As a result, you inherit Controller into your UserController class.

Dependency injection

Get hands-on with 1200+ tech skills courses.