Latest Posts On Code Maze

Create Clean Guard Clauses With GuardClauses in C#

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...

Determine Whether Two Date Ranges Overlap in C#

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

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.

To download the source code for this article, you can visit our GitHub repository.
A very beginner-friendly article to starting with EF Core...

.NET Dependency Injection With Constructor Parameters

.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#

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...

How to Execute CLI Applications From C#

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...