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:

ConcurrentBag in C#

In C#, there are many classes that we can use to represent a group of objects that we may manipulate concurrently using multiple threads. One such class is the ConcurrentBag<T>. In this article, we will learn how to add, access, and remove elements from a...

How to Add a BearerToken to an HttpClient Request

Often, in our daily routine, we have to deal with secure APIs and use a BearerToken to make HTTP requests. In this article, we are going to learn the correct way to add a BearerToken to an HttpClient request. [sc name="patreon-source-code"...

Task vs ValueTask in C#: When to Use Each

Return Task by default. Use ValueTask only for a method that is called constantly and usually finishes without ever awaiting anything (a cache lookup that normally hits, a buffered read that normally has data). The reason is what each one costs when it completes...

Different Ways to Use Select Tag Helper in ASP.NET Core

In this article, we are going to learn about the select tag helper and its various uses. We are going to start with a brief overview of what exactly tag helpers in ASP.NET Core are and then proceed to learn more about the select tag helper. [sc name="github"...

ToString Method in C#

Representing data as strings is an inbuilt feature of the C# language and is a common operation in applications. In this article, we are going to learn how we can use the ToString() method in C# through an example. [sc name="github"...

IEnumerable in C#

In this article, we are going to learn about IEnumerable in C#. IEnumerable acts as an abstraction over a collection and allows us to iterate over it without knowing the actual type of the collection. [sc name="github"...

BitArray in C#

In this article, we are going to learn about BitArray class in C#, how to create an instance of it, and what its properties and methods are. We're also going to learn about the difference between BitArray and bool array. [sc name="github"...

Working With Collections in .NET

When we develop software applications, we may need to create, store and manipulate groups of related objects. In this article, we will discuss the various ways in which we can perform such operations using different collections in .NET. [sc name="github"...

Nullable Types in C#

In this article, we will extensively break down the concept of Nullable types in C#. We will discuss the kinds of Nullable types in C#, their characteristics, and how we can use them when building applications. [sc name="github"...

Quartz.NET in C#: How to Schedule Jobs

Quartz.NET is a job scheduling library for .NET built from three pieces: a job is the code that runs, a trigger decides when, and a scheduler holds them together and fires them. Everything else is a variation on those three. A trigger can repeat on an interval or...

How to Implement a LinkedList in C#

In this article, we are going to explore the main concepts behind a linked list. We are going to see how to implement a LinkedList in C# using the LinkedList and LinkedListNode classes and then, how to implement custom linked list classes and methods. [sc...

How to Enumerate an Enum in C#

In this article, we're going to look at some of the ways we can enumerate an Enum in C#. Enums allow us to declare a group of related constant values in a readable way where the underlying data type is usually an integer.  [sc name="github"...

Producer-Consumer Applications With .NET Channels

When building applications, usually we need to create long-running background tasks, that can be sent to one or more background processes. This is known as a producer/consumer pattern. For these scenarios, we need something more robust than a first-in, first-out...

Float vs Double vs Decimal in C#: Which to Use?

Use double for numbers, decimal for money. double is the fast, 64-bit default that every maths library and API expects; decimal is slower and bigger but stores decimal fractions exactly, so amounts add up to the cent. float is the one to skip. It is half the size of...

Hashing and Salting Passwords in C# – Best Practices

In a system that stores user credentials, we must pay careful attention to how we store passwords. We must never store passwords in plain text. In this article, we will learn how to use hashing and salting techniques in C# to safely store user passwords. [sc...