Skip to content

Latest commit

 

History

History
19 lines (15 loc) · 422 Bytes

Controller.md

File metadata and controls

19 lines (15 loc) · 422 Bytes

Controller

To mark a class as a controller you have to use the Controller attribute.

[Controller]
public class HomeController(ILogger<HomeController> logger)
{
}

The Default route of the controller is just /, but you can pass an argument to the attribute which will override the base route of the controller.

[Controller("home")]
public class HomeController(ILogger<HomeController> logger)
{
}