Latest Posts On Code Maze

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

How to Compare Two Files in C#

How to Compare Two Files in C#

In this article, we will learn how to compare two files in C#. There are several reasons why we might want to compare two files in our code, such as integrity checks, detecting duplicate files, version control, synchronization, and more. But what are the different...

How to Set Global Default JSON Serialization Options in .NET

How to Set Global Default JSON Serialization Options in .NET

JSON serialization is the process of transforming .NET objects into JSON format, which ensures data exchange within applications. Implementing global default JSON serialization settings in ASP.NET Core Web API maintains uniformity across applications. In this article,...

How to Filter a List Based on Another List In C#

How to Filter a List Based on Another List In C#

Lists in C# are one of the most ubiquitous data structures. We perform all kinds of operations on them, such as appending, inserting, removing, sorting, and filtering. In this article, we'll focus on the latter - filtering. In particular, we'll see how to use a list...

View-Based Authorization in ASP.NET Core

View-Based Authorization in ASP.NET Core

View-based authorization is an authorization strategy that enables us to manage UI elements' visibility based on the user's identity. In this article, we'll take a look at how we can achieve view-based authorization in an ASP.NET core application. [sc name="github"...

Add a Cookie to an HttpClient Request/Response in ASP.NET Core

Add a Cookie to an HttpClient Request/Response in ASP.NET Core

What are cookies? Websites send small pieces of text, known as internet cookies, to our browsers whenever we visit them. They help us have a personalized experience on that particular website and remember it for the next time we visit it. Our goal today is how to make...

How to Generate a Random Color Name in C#

How to Generate a Random Color Name in C#

In this article, we will learn how to generate a random color name using the KnownColor enumeration. This enum is particularly useful in UI design and data visualization, as it provides a wide variety of preset colors. [sc name="github"...