Join the Series for FREE π - Subscribe
When building a new ASP.NET Core project, one should prioritize setting up logging to ensure robust monitoring and debugging capabilities right from the start. Serilog is the most popular logging library for ASP.NET Core Applications. In this article, we will learn everything you need to know to master Structured Logging in your ASP.NET Core Application using Serilog.
Exception Handling is vital for applications of all types and traffic volumes. If exceptions are not handled well within the application, it may break the entire application or even lead to data loss. In ASP.NET Core, there are multiple ways that one can handle exceptions effectively.
In this article, we will discuss various approaches like Try-Catch Blocks, Default Exception Handling Middleware, Custom Exception Middleware, and IExceptionHandler. Starting from .NET 8, IExceptionHandler
is the recommended and cleaner approach to handle exceptions!
When it comes to Validating Models and incoming HTTP Requests, arenβt we all leaning toward Data Annotations? Although it can be quick to set up Data Annotations on your models, there are a few drawbacks to this approach.
In this article we will try to understand the problems with Data Annotations for larger projects, and use an alternative, FluentValidation
in our ASP.NET Core application. It can turn up the validation game to a whole new level, giving you total control and write much cleaner code.