Breaking down the MVC Template
Skip to main content

Development blog

This blog contains posts mostly regarding development in core. System Engineering and DevOps topics are also covered in this blog.
Most of the content published on this homepage is a practical approach to official documentations like I try to link the related parts of said documentations in every post.

If you feel that you are able to improve this blog by providing any kind of update or feedback, please do so via the comments section or the contact form.

Enjoy reading!

Breaking down the MVC Template

In the last blogpost I created a MVC WebApp with a default template. Lets break it down and take a look at it.

Screenshot 2019-01-30 at 19.40.02

 If you know how to work with Microsoft technologies, the root structure with a solution the projects will look familiar to you. On top (marked blue) we got the Solution named TestProject. Below it, there is the Project "TestProject", that we have created.

Lets skip the dependencies for now.

If you are familiar concepts of MVC you will find the expected folders for Controllers, Models and Views. For now, we only got the HomeController, which handles all our requests.

As this WebApp does not handle any custom Entities yet, there is no model except for the ErrorViewModel.

As one would expect, launchSettings.json defines  parameters for the WebServer to start the project which include the port/ports, bindings etc.

Below the Views section you will find the .cshtml files that contains the html-code that will be rendered by the associated controller and some shared content that I will explain in one of the next posts.

The wwwroot folder contains static content like bootstrap, .js files, etc.

Appsettings.json contains information that used to appear in the web.config, like ConnectionStrings for databases and other configurations which you may change in different environments.

Program.cs is a small class, that runs on the webserver. It's not very likely, that you need to change more than a few parameters in there.

Startup.cs contains most of the Apps configuration. This file will get its own chapter.

Categories: Default, core

DevOps Engineer at TIMEWARP IT Consulting GmbH

Read more posts by Marius Steinbach