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:

Difference Between String, FormattableString, IFormattable in C#

C# provides different ways of manipulating strings, which can be helpful when designing and implementing systems. So, in this article, we will delve deep into the distinctions among String, FormattableString, and IFormattable in C#. Besides that, we will test whether...

How to Get a JSON Array Using IConfiguration in ASP.NET Core

In this article, we will explore how to get a JSON array using IConfiguration. In modern web applications, JSON is a widely used data interchange format due to its lightweight nature and ease of use. When developing an ASP.NET Core application, it is common to store...

Readonly Modifier in C#

In this article, we are going to learn about the readonly modifier in C#. However, before we go into detail on this topic, it is important to understand the concepts of mutability and immutability in programming. [sc name="github"...

How to Use Mutex in C#

In this article, we are going to learn how to use the Mutex class in C#. Multithreading can significantly boost an application's performance, but it also brings challenges related to synchronizing and coordinating tasks across different threads (and even processes)....

How to Mark Methods as Deprecated in C#

In this article, we will explore how we can mark methods as deprecated and propose newer alternatives to developers in C# by providing useful information. [sc name="github"...

Implement API Key Authentication in ASP.NET Core

Many developers widely use API key authentication to secure API endpoints. This approach necessitates clients to provide a valid API key for accessing the endpoints. When implementing API key authentication in ASP.NET Core, it's crucial to understand how to pass the...

How to Mock IOptions in ASP.NET Core

In this article, we'll unveil a straightforward approach to mock IOptions<T>, ensuring our tests remain both thorough and independent of real-world configurations. [sc name="github"...

Prevent SQL Injection With EF Core, Dapper, and ADO.NET

SQL Injection is a severe security vulnerability that can harm applications that use databases. In this article, we'll learn about SQL Injection attacks, what they can do, and how to protect our applications from them. We'll focus on using popular ORM tools like EF...

Differences Between Const and Readonly in C#

In this article, we will discuss the differences between const and readonly keywords in C#. const and readonly allow us to declare immutable values in C#. [sc name="github"...

How to Determine .NET Version Programatically

.NET Framework allows us to create applications for various platforms and devices. With each new version, .NET introduces new features and fixes, while rarely including changes that could cause compatibility issues. Therefore, upgrading a .NET project to a newer...

Primary Constructors for Classes and Structs in C#

In this article, we'll take a look at a new feature of C# 12 and .NET 8 for classes and structs called primary constructors that is still in preview at the time of writing the article. [sc name="github"...

Refactoring Couplers in C#

In this article, we will learn about couplers, their impact, and how to find and fix them. Couplers establish dependencies between components, making our code challenging to understand, modify, and test. The knowledge about how to untangle our code can certainly help...