code4it-dev / blog-comments

https://www.code4it.dev/
1 stars 0 forks source link

csharptips/custom-middleware/ #56

Open utterances-bot opened 12 months ago

utterances-bot commented 12 months ago

C# Tip: 2 ways to define ASP.NET Core custom Middleware | Code4IT

Code4IT - a blog for dotnet developers

https://www.code4it.dev/csharptips/custom-middleware/

drmcclelland commented 12 months ago

Another option for standalone classes is to implement the IMiddleware interface, so you don't have to depend on convention magic. Bart Wullems has a good overview of all the approaches here: https://bartwullems.blogspot.com/2023/05/aspnet-corefactory-based-vs-convention.html