Best practices for handling exceptions in C#

Exception handling is the technique of handling runtime errors in your application code. Basically, you have two categories of exceptions: Exceptions that are generated by the application and exceptions that are generated by the runtime. Exceptions should be handled with care. You should have a good idea of how exceptions should be handled and when…

Read More

Microsoft .NET 9 previews C#, runtime, SDK improvements

Microsoft has released a seventh preview of its forthcoming .NET 9 software development platform, with enhancements to C# for API authors. The .NET runtime, SDK, and other areas also are improved. Accessible from dotnet.microsoft.com, .NET 9 Preview 7 was unveiled August 15. .NET 9 is expected to be introduced as a production release in November,…

Read More

How to use FluentValidation in ASP.NET Core

To preserve the integrity, consistency, and security of application data, you should ensure that your application receives the correct data in a proper format. A popular open-source library in the C# ecosystem handles this perfectly and easily—FluentValidation. FluentValidation is a validation library for .NET that provides a fluent interface to build strongly typed validation rules…

Read More

How to use FastEndpoints in ASP.NET Core

FastEndpoints is a free and open-source REST API development framework for .NET Core that can be used to build lightweight and fast APIs. In this article, we’ll examine this library and learn how to use it to build lightweight APIs in ASP.NET Core applications. ASP.NET Core supports two built-in approaches to building APIs, traditional controllers…

Read More