ASP.NET Core MVC Tutorial Part 1

Alex
6 min readApr 26, 2021

Hello, I have been interested in ASP.NET Core for some time now and have been playing about with MVC including creating routes, controllers etc. So I thought a great way of expanding and retaining my knowledge of MVC would be to write tutorials on this topic.

What is MVC?

We first have to ask ourselves what exactly is MVC? MVC is an architectural pattern i.e. a way a building software which separates the software into 3 main concerns, these being Models, Views & Controllers. One of the main reasons to implement an MVC software project is that it helps achieve a principal called “separation of concerns” which promotes the idea that software should be separated based on the type of functionality it performs i.e. the Model will contain the business logic such as properties like ID, firstName, lastName. The view will be responsible for showing content to the user through a user interface using a view engine such as Razor, in addition, the controller helps to choose which view to show to the user depending on different links clicked as well as work with the model data. The separation of these 3 components helps to ensure that testing is easy to do.

I will be using Rider to create a simple solution in this tutorial where we create a controller that maps to a different route and will show different text on our page, to do this we will…

--

--

No responses yet