Every web application calls external web services and it's often desired to limit the number of requests we send to external web services in a duration of time for example we want to send a maximum of 100 requests from our application to XYZ external web service per minute so in that case, we would like to throttle the outgoing requests going to web services.
Filters are essential concepts of ASP.NET Core. Although Filters were present in Legacy ASP.Net Framework, middleware was introduced in ASP.Net Core. In Legacy ASP.NET Framework we had HttpModules and HttpHandlers which were part of the request pipeline but in ASP.NET Core we have middleware which is part of the request pipeline. Both Filters and Middlewares have some commo..
Exception Handling is an important thing for every application and C# language provides different ways to handle the exception. We can handle exception locally in the method as well as globally but it's not efficient to add a try/catch block in every method as logging the error from every catch block of the method is not efficient as it violates code reuse so efficient way is to add global exce..
Every application requires does some kind of Pre and Post-processing logic to sometimes validate or to do custom logic before executing and returning the actual result. ASP.NET Core provides multiple ways to do the same namely Filters, Middlewares, etc...
We can have multiple middlewares, Filters in a typical application to validate or to do custom implementation to every request in the w..