Author: Code Maze

Unit Testing in ASP.NET Core MVC

In this article we are going to cover Unit Testing or rather why we need unit tests and how to implement them in our ASP.NET Core applications. If you’ve missed some of the previous articles in the series we recommend visiting the series page: ASP.NET Core MVC Series. To download this article’s source code visit: Unit Testing in ASP.NET Core MVC. We have divided this article into the following sections: Why do we Need Unit Tests Setting Up the Unit Testing Framework Unit Testing Controller Methods Let’s start. Why do We Need Unit Tests Our applications can fail in unexpected...

Read More

File Upload in ASP.NET Core MVC

File Upload is the process of uploading files from the user’s system to the web application’s storage. ASP.NET Core MVC actions support uploading of one or more files using simple model binding. We have covered the file upload support in ASP.NET Core Web API in detail in the article Uploading Files With .NET Core Web API and Angular. There we looked at how to upload a file using an angular app in the client side and an ASP.NET Core Web API in the server side. In this article, we are going to look at how to achieve the same...

Read More

Routing in ASP.NET Core MVC

In this article, we’re going to discuss the routing capabilities in ASP.NET Core MVC. We’re also going to learn how to set up routes in two different ways. If you’ve missed some of the previous articles in the series we recommend visiting the series page: ASP.NET Core MVC Series. To download this article’s source code visit: Routing in ASP.NET Core MVC. We have divided this article into the following sections: Routing in ASP.NET Core MVC Conventional Routing Multiple Routes Attribute Routing Multiple Routes Let’s dive into the material. Routing in ASP.NET Core MVC Routing is the process through which...

Read More

State Management in ASP.NET Core MVC

HTTP is a stateless protocol. HTTP requests are independent messages that don’t retain user values or app state. We need to take additional steps to manage states between the requests. In this article, we are going to look at various approaches to preserve user data and app state between the requests.

Read More