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:

How to Revert a Migration in EF Core

In this article, we will show how to revert a migration in EF Core. Entity Framework Core is an excellent tool for managing data structure by using familiar object types. If you need a refresher on the basics of EF Core, be sure to check out our full Entity Framework...

How to Ensure a String Is Valid JSON in C#

In this article, we delve into the different approaches to ensure a string is valid JSON in C# by providing detailed explanations and practical examples. JavaScript Object Notation, more commonly known as JSON, has become the de facto data format for interchange...

How to Save a List to a Text File in C#

In this article, we will delve into the methods to save a list to a text file using two C# classes: StreamWriter and File. We will also discuss which class best aligns with the specific requirements for file operations. [sc name="github"...

How to Escape the Backslash Character in C#

In this article, we will explore different ways to escape the backslash (\) character in C#. By the end, we will have a solid understanding of the best practices for representing literal backslashes in C#, ensuring accurate representations, and preventing unintended...

When to Use Thread.Sleep, When to Use Task.Delay?

In this article, we will explore the differences between Thread.Sleep() and Task.Delay(), two commonly used mechanisms for introducing delays in code. Understanding these differences is critical for developers working with multithreading and asynchronous programming....

How to Append or Update Query String Values in C#

In web development, query strings facilitate communication between clients and servers. A query string is a part of a URL containing data parameters that transmit information from one page to another. In C# development, effectively appending and updating query string...

Client-Server Architectural Pattern in C#

The Client-Server Architectural Pattern is a system that divides an application between clients that initiate requests and the server that fulfills them. This model of architecture forms the basis of countless applications, from web browsing to email. In this article,...

Differences Between NUnit, xUnit and MSTest

A testing framework provides us with an approach to automating the validation of the functionality and performance of our code. In this article, we will look at the three major testing frameworks (NUnit, xUnit, and MSTest) that are available for a .NET project. ...

How to Initialize Parameters of a Record in C#

In this article, we are going to learn how to initialize the parameters of a record type in C#. For an overview of what records are, have a look at this article. [sc name="github"...

Default Values for Lambda Expressions in C#

Microsoft released the newest version of the C# language, C#12. This new release has fresh improvements that make C# even better for developers, such as default values for lambda expressions. To become familiar with this change, let's dive into the topic and learn its...

Implement Custom Authorization Policy Provider in ASP.NET Core

Authorization policies play a major role in modern ASP.NET Core authorization. We generally register authorization policies by giving them a name and specifying their requirements while configuring our startup application. We've covered how to do that in the previous...

How to Retrieve JSON Property Names in C#

In this article, we will learn how to retrieve property names from a JSON object in C#. We can achieve this either through reflection or through one of the widely used JSON libraries such as Newtonsoft.Json and System.Text.Json.  [sc name="github"...

How to Serialize an Object into Query String Format in C#

In this article, we will learn how to serialize an object into query string format using C#. We will discuss the challenges we face when dealing with nested objects and arrays and how to deal with them. [sc name="github"...

Debugging and Profiling Multithreaded .NET Applications

In this article, we'll dive into a comprehensive guide about the various tools available in Visual Studio for the debugging and profiling of multithreaded .NET applications. Multithreading, that sounds scary. Well, not really. [sc name="github"...

Querying MongoDB With ObjectId in C#

In this article, we will look at how to retrieve MongoDB documents using ObjectId in C#. We will only cover how to query a MongoDB database using ObjectId in C#. Check out our article Getting Started with ASP.NET Core and MongoDB for more information on how to set up...