Posts

Showing posts with the label Mediate

Exceptions should be hardly used in exception : Inner Voice #Microsoft #Core #Pipeline

Image
Exceptions are fully asynchronous and nested but extremely expensive, even more expensive than usual when they are in the ASP.Net Core Pipelines. Microsoft Performance Team had raised this concern for high scale services long back, To improve performances sharing couple of key points when developing with .net core Async Void Methods: Using async void in ASP.NET Core is considered a bad practice because unhandled exceptions thrown from these methods will crash the entire process. It is recommended to use Task-returning methods instead. HttpContext Usage: Accessing HttpContext from multiple threads in parallel, storing it in a field, or using it after the request is complete can lead to NullReferenceException or other issues because it is not thread-safe and is disposed after the request pipeline ends. Exception Handling Middleware: The built-in UseExceptionHandler middleware is designed to catch exceptions early in the pipeline. It cannot handle exceptions if the respons...

Popular posts from this blog

Ohh It is digital transformation, .. Really ?

Respect is not earned, It is given ⚘ 🙏

Need > Want