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:

LINQ Improvements in .NET

In this article, we will discuss the new LINQ improvements introduced in .NET 6.  We will not talk about the LINQ itself because we already have an article on that topic. [sc name="github"...

Concatenate Lists in C#

In this article, we are going to cover six different ways to concatenate lists in C#. After learning about every approach, we are going to evaluate some benchmarks to find out which is the most efficient approach.  [sc name="github"...

How to Implement Lucene.NET

In this article, we are going to be learning how to implement Lucene.NET in C#. We will cover the entire process from installing the library, to indexing and searching. [sc name="github"...

Polymorphic Serialization and Deserialization with System.Text.Json

In this article, we are going to deal with a special case of JSON processing, polymorphic serialization, and deserialization with System.Text.Json. The introduction of the System.Text.Json package has given .NET developers another powerful option for JSON format...

How to Convert String Array to String in C#

In this article, we are going to learn how to convert a string array to a string in C#. We will cover five different approaches to achieve the same result, and in the end, we will inspect benchmark results to see the fastest way to accomplish the conversion.  [sc...

How to Merge Arrays in C#

In this article, we will learn how to merge arrays in C#. This functionality will allow us to combine two or more arrays. Working with arrays is essential when performance matters to us since arrays work faster than many other data structures. We will use different...

Base64 Encode and Decode in C#

In this article, we will learn about how to Base64 encode and decode in C#. Let’s dive in. What is Base64 Encoding? Base64 are symbols...

Cookie Authentication With ASP.NET Core and Angular

In this article, we're going to learn about cookie authentication with ASP.NET Core and Angular. We'll create an ASP.NET Core Web API with sign-in, sign-out, and a protected user endpoint for demonstration. In Angular, we'll access the protected user endpoint after...

Covariance and Contravariance in C#

In this article, we’re going to learn why covariance and contravariance are important, what they are, and how to use them in various scenarios using a few examples. [sc name="github"...

How to Turn a C# Object Into a JSON String in .NET?

In this article, we're going to learn how to serialize a C# object into a JSON string using the two main JSON libraries in the .NET ecosystem. Also, we're going to learn how to control different aspects of the serialization process. [sc name="patreon-source-code"...

Constructors in C#

In this article, we will discuss Constructors in C# and different types of constructors. More importantly, we will discuss these constructors' differences and use cases. [sc name="github"...

Unsafe Code in C# (unsafe keyword)

In this article, we are going to learn about the unsafe code in C#. In general, the code that we write in C# is safe code. It creates managed objects and doesn't access the memory directly. On the other hand, unsafe code in C# is code that is not in direct control of...

Using Moq to Determine If a Method is Called

In this article, we are going to see how to determine if a method is called during test execution. To do that, we are going to use Moq and its verification APIs. [sc name="github"...

HttpClient vs RestSharp – Which One to Use in .NET

HttpClient and RestSharp are HTTP Client libraries that we can use to consume APIs. Working within the domain of Web Development, we will find ourselves in a situation where we need to consume external APIs. Both HttpClient and RestSharp are tools for implementing...

Shell Sort in C#

Have you ever needed to sort a list of items, but didn't want to use the built-in sorting function? If so, you may be interested in learning about Shell Sort, which is similar to insertion sort but uses a different approach to sorting. In this article, we'll take a...

How to Resolve Instances With ASP.NET Core DI

In ASP.NET Core dependency injection, we usually register injectable dependencies at the start of our program. We can then resolve these dependencies (services) much later once when we need them. Sometimes, however, we may need to resolve those dependencies even...

Ranges and Indices in C#

In this article, we are going to learn more about ranges and indices in C#, and how to use them to access a single or a range of elements in a sequence. We'll also see how ranges and indices help us write cleaner and more readable code. [sc name="github"...