Author: Code Maze

Filters in ASP.NET Core MVC

Filters in ASP.NET Core MVC allows us to run certain actions before or after specific stages in the request processing pipeline. There are some built-in filters in ASP.NET Core. We can also write custom filters to execute actions at various stages of the request pipeline. They also help us to handle cross-cutting concerns and avoid duplication of codes. We have discussed Filters in detail in the Implementing Action Filters in ASP.NET Core article. In that article, we have explained how to implement an Action Filter in an ASP.NET Core Web API application. In this article, we’ll explain the different...

Read More

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