Create Clean Guard Clauses With GuardClauses in C#
In this article, we discuss how to create guard clauses, how they differ from user input validation, and how to improve our guards by writing clean guard clauses leveraging the GuardClauses library. Sometimes passwords can end up being exposed even if...
How to Modify a Base URI of Swagger in ASP.NET Core
In this article, we’re going to learn how to change Swagger base uri in ASP.NET Core Web API. So let's start. Swagger and Base Uri Swagger is an...
Determine Whether Two Date Ranges Overlap in C#
In this article, we will discuss how to determine whether two date ranges overlap in C#. We will explore how to achieve this result using the DateOnly and TimeOnly records and then, we're going to beautify our implementation with a custom class representing date...
Multipart Form-Data in HttpClient with ASP.NET Core
In this article, we will learn what multipart requests are and how we can use them. Also, we will review examples of how to send data to remote servers using multipart form-data with HttpClient in ASP.NET Core.
.NET Dependency Injection With Constructor Parameters
Introduction In this article, we'll look at ways to use dependency injection with constructor parameters in .NET Core. Dependency injection (DI) with constructor parameters is a way for us to pass the things our class needs (depends on) when we create a new instance...
How to Return a Default Value From a Dictionary in C#
In this article, we are going to present you solutions on how to return a default value from a Dictionary in C# and run an evaluation test against these methods to find the most efficient. While there are some nice NuGet packages to help us with...
Two Factor Authentication with Web API and Angular using Google Authenticator
In this article, we will enable Two-Factor Authentication with Web API and Angular using Google Authenticator. We can use the Google Authenticator app to get a One-Time Password (OTP) value to enter during login. The initial steps of this article have been taken from...
How to Execute CLI Applications From C#
In this article, we will learn how to execute CLI applications in C# using a built-in class called Process and using open-source libraries. We will cover how we can execute CLI, how we can check if the CLI execution was successful, and how we can react to the...