Module 05 of 12

Middleware & the Request Pipeline

Lessons

About This Module

Every request to an ASP.NET Core app flows through a chain of middleware — small components that can inspect, change, or short-circuit the request on the way in and the response on the way out. The order you register them in matters, and getting it right is the difference between an app that behaves predictably and one that quietly breaks authentication or error handling.

This module starts with built-in and custom middleware, including how ordering works. It then covers filters, which hook into the MVC action pipeline after a route has been chosen, followed by global exception handling with custom middleware and IExceptionHandler, and finishes with structured logging so you can see what your app is doing in production.

Watch the lessons in order, then continue on to Razor Pages & MVC.

Lessons

4 videos
01

.NET API Middleware for Common Functionality

A lesson from Microsoft's back-end .NET for Beginners series on implementing common behavior with middleware. It covers using built-in middleware, writing your own, and why middleware ordering matters.

02

Custom Filters in ASP.NET Core Web API

Covers filters in Web API, including action, resource, and authorization filters, with real-time examples of running code before and after specific stages of request processing.

03

Global Error Handling in .NET

Two production-ready ways to catch unhandled exceptions in your .NET apps: a custom middleware approach and the IExceptionHandler feature introduced in .NET 8.

04

Serilog in ASP.NET Core: ILogger, Sinks, Seq and Enrichers

A beginner-friendly guide to structured logging in .NET that explains what ILogger is, what Serilog adds on top of it, and how to install and configure it.