AspNetCore.Docs/aspnetcore/tutorials/first-mvc-app-xplat/adding-controller.md

840 B

title author description ms.author ms.date uid
Add a controller to an ASP.NET Core app rick-anderson Learn how to add a controller to a simple ASP.NET Core MVC app. riande 02/28/2017 tutorials/first-mvc-app-xplat/adding-controller

Add a controller to an ASP.NET Core app

By Rick Anderson

[!INCLUDE adding-controller]

  • In VS Code, select the EXPLORER icon and then control-click (right-click) Controllers > New File and name the new file HelloWorldController.cs.

    Contextual menu

[!INCLUDE adding-controller2]

[!div class="step-by-step"] Previous - Add a controller Next - Add a view