Archive For August 2022

Strongly Typed Middleware in ASP.NET Core

calendar_today 24 August 2022 12:30

.NET 6 ASP.NET Core Razor Pages

Most ASP.NET Core developers are familiar with the traditional way to author middleware classes which is based on conventions. The vast majority of examples out there feature the convention-based approach. But there is also a strongly typed approach available which is based on implementing the IMiddleware interface. This seems to be one of ASP.NET Core's best kept secrets, so I thought I'd pull the curtains back and let some light shine on it.