Code Maze Author

Code Maze

This is the standard author on the site. Most articles are published by individual authors, with their profiles, but when several authors have contributed, we publish collectively as a part of this profile.
Also find me here:



MY ARTICLES:

How to Find the Caller Method in C#

In this article, we will learn how to find the caller method in C#. We will also learn about scenarios in which this information could be useful and how to retrieve it. [sc name="github"...

TimeSpan in C#

Creating robust applications and solutions that can stand the test of time requires using complex dates and timespans to ensure accuracy. C# offers a robust TimeSpan structure that allows developers to easily manipulate dates, durations, and ranges. In this article,...

How to Read Connection Strings in .NET

 In this article, we will learn how to read database connection strings from different configuration sources in .NET applications. [sc name="github" url="https://github.com/CodeMazeBlog/CodeMazeGuides/tree/main/aspnetcore-features/HowToReadConnectionStringsInDotNet"...

IEnumerable, ICollection, IList and List – Which One To Use?

In this article, we will learn about IEnumerable, ICollection, IList, and List. We will also focus on how to choose the right one. [sc name="github" url="https://github.com/CodeMazeBlog/CodeMazeGuides/tree/main/collections-csharp/IEnumerableVsICollectionVsIListVsList"...

Convert a File to a Byte Array in C#

In this article, we will learn about situations where we may need to convert a file into a byte array. Additionally, we will learn two ways to perform the conversion in C#. If you want to learn how to convert a byte array to a file, check out our convert byte array to...

Resolving the Call Is Ambiguous Error While Using LINQ

In this article, we will learn when the "call is ambiguous" error happens, why the error happens, and how to work around the issue. There are still so many legacy projects using older versions of EF Core, and in those projects, this error can cause a lot of headaches...

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. [sc name="github"...

File and FileInfo Class Comparation in C#

In this article, we will look at the power of the File and FileInfo classes used for file manipulation in C#.  We'll uncover the similarities and differences between these two classes and why we would want to use one over the other.  [sc name="github"...

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. [sc name="github"...

How to Get Formatted JSON in .Net Using C#

This article will examine how we can get a formatted JSON representation of our C# objects using two popular libraries - Json.NET and System.Text.Json. [sc name="github" url="https://github.com/CodeMazeBlog/CodeMazeGuides/tree/main/json-csharp/HowToGetFormattedJson"...

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

Asynchronous Programming Patterns in .NET

In this article, we are going to learn about the various patterns to implement asynchronous programming in .NET. .NET has had in-built support for asynchronous programming since the release of .NET Framework 1.1. It has been through various improvements over the...