Skip to main content

Extensions Methods

Namespace: RA.Utilities.Api.Middlewares.Extensions

The extension methods in the RA.Utilities.Api.Middlewares.Extensions namespace serve as convenient shortcuts for registering your custom middlewares with the ASP.NET Core application pipeline.

In ASP.NET Core, the standard way to add a middleware is by calling app.UseMiddleware<TMiddleware>(). While this works perfectly fine, it can be a bit verbose.

The extension methods, UseHttpLoggingMiddleware() and UseDefaultHeadersMiddleware(), provide a cleaner, more readable, and more discoverable way to do the same thing. This is a common convention used by Microsoft and other popular library authors in the .NET ecosystem.

🧩 Available Extensions