Latest Posts On Code Maze

Differences Between Span and Memory in C#

Differences Between Span and Memory in C#

In this article, we'll briefly explain the Span and Memory .NET types and mention their primary usage. Furthermore, we will explore the differences between Span and Memory in C# in depth and conclude with some general tips on when to use one type over another. [sc...

Weak Events in C#

Weak Events in C#

We use weak events in C# to avoid memory leaks in event-based applications. Let's learn more about weak events, why they're needed, and how to implement them. [sc name="github"...

Retrying Failed HttpClient Requests in .NET Using Polly

Retrying Failed HttpClient Requests in .NET Using Polly

In this article, we will explore the different approaches to retrying failed HttpClient requests using Polly. We will also discuss the advantages and disadvantages of each retry strategy, from simplest to most sophisticated. [sc name="github"...

How to Use the LINQ ToDictionary Method in C#

How to Use the LINQ ToDictionary Method in C#

In this article, let's describe how to use the LINQ ToDictionary() method in C#. We will start by defining this method and how it works. Then, we will proceed to show several ways of invoking it. Ultimately, we will discuss different situations where we can utilize...

Bouncy Castle Cryptography Library for .NET

Bouncy Castle Cryptography Library for .NET

Cryptography remains an ever-important topic in building modern security-minded applications. Bouncy Castle is a cryptography library for .NET that allows users to build robust cryptography features. In this article, we will cover just a few important capabilities...

Embedded Resources in .NET

Embedded Resources in .NET

We've covered resources in a couple of our previous articles. In Localization in ASP.NET Core, we delved into .NET localization, touching upon resources since XML files utilized for localization fall under .NET resources. We also discussed resources in our article,...

How to Print a 2D Array to the Console in C#

How to Print a 2D Array to the Console in C#

In this article, we will learn how to print a 2D array to the console using C#. Whether we are handling complex data structures or simply organizing information efficiently, understanding how to manipulate 2D arrays is a valuable skill. [sc name="github"...

Getting Started With EasyCaching in ASP.NET Core

Getting Started With EasyCaching in ASP.NET Core

EasyCaching is an open-source caching library that helps us manage caching more easily, and flexibly and it's an alternative to ASP.NET Core's out-of-the-box caching library. Caching is a prevalent and useful technique for improving the performance of web...

Lookup in C#

Lookup in C#

When we build our .NET applications, we commonly use dictionaries to store data as key-value pairs. However, dictionaries do not allow us to map multiple values to a single key. In this article, let's explore the Lookup class in C# and discuss how we can use it to...

Modular Monolith Architecture In .NET

Modular Monolith Architecture In .NET

In this article, we will discuss the concept of Modular Monolith Applications, and how they compare with traditional Monoliths and Microservices. We will also explain the different communication patterns we can implement between our modules. [sc name="github"...

Fastest Ways to Perform Base 10 Conversions in C#

Fastest Ways to Perform Base 10 Conversions in C#

Performing base 10 conversions is fundamental when learning basic computer science and mathematical concepts. Since we know computer systems understand binary, such conversions can help us form different number representations that we can use for various applications...

How to Compare Two Dictionaries in C#

How to Compare Two Dictionaries in C#

In this article, we will first explore several ways to compare two dictionaries in C#. Then, we will compare and rank the performance of these approaches using the BenchmarkDotNet library. When we work with Dictionary objects in C#, checking their equality is a common...

Introduction to the StronglyTypedId Package in .NET

Introduction to the StronglyTypedId Package in .NET

In this article, we'll look at the StronglyTypedId NuGet package and how it helps us enhance type safety and code readability in our .NET projects by generating strongly-typed IDs for our entities. [sc name="github"...