This repository contains 4 minimal and practical examples of custom middleware in ASP.NET Core. Each example is self-contained, easy to understand, and focused on a specific use case.
📝 These examples are also explained in detail in the blog post:
👉 Read the blog post here!
.
├── Example1_RequestLogging/
├── Example2_MultipleMiddleware/
├── Example3_ResponseTime/
├── Example4_IpFilter/
└── README.md
Each folder contains an independent ASP.NET Core project demonstrating a specific middleware concept.
You can run any example individually:
cd Example1_RequestLogging
dotnet run
.NET 9 SDK