Latest Posts On Code Maze

How to Check if a File Is in Use With C#

How to Check if a File Is in Use With C#

File manipulation is a common and broad thing in the .NET world and in some cases can lead to certain exceptions. In this article, we will focus on files already in use, and see how we can avoid it.  [sc name="github"...

REST vs WebSockets in C#

REST vs WebSockets in C#

Generally, REST and WebSockets are both means of ensuring communication between two or more applications. In this article, we are going to look into them in detail to understand their individual strengths, and weaknesses and when to choose one over the other. [sc...

The Differences Between Quartz.NET and Hangfire

The Differences Between Quartz.NET and Hangfire

There are many scenarios for background tasks, ranging from a task that runs for a long time to perhaps an operation that needs to be retried multiple times if it fails, and many other scenarios in between. In this article, we will discuss the differences between...

ConcurrentStack in C#

ConcurrentStack in C#

In this article, we will take a closer look at the .NET collection ConcurrentStack. As software development evolves, multi-threading has become essential for efficient, scalable applications. However, managing concurrent operations, especially due to thread-safety...

Using Static Anonymous Functions in C#

Using Static Anonymous Functions in C#

In this article, we'll review static anonymous functions, which were introduced in C# 9. To understand how they can improve our code, we should first have a look at non-static anonymous methods and lambda expressions. Let's see what happens, as far as memory...

Standard and Custom Numeric Format Strings in .NET

Standard and Custom Numeric Format Strings in .NET

In this article, we will look at the different standard and custom numeric format strings in .NET. Additionally, we will look at the support for the numeric format strings. [sc name="github"...

How to Get a Database Row as JSON Using Dapper

How to Get a Database Row as JSON Using Dapper

In this article, we will explore how to retrieve a database row as JSON using Dapper in the context of an ASP.NET Core Web API project. Our focus will be on data retrieval and serialization. We'll exclude discussions of the intricacies of Dapper itself and the setup...

How to Use Interceptors in C# 12

How to Use Interceptors in C# 12

In C# 12, interceptors are a new experimental compiler feature that enables rerouting specific method calls to different code. Typically, developers use interceptors with code generators to modify the behavior of existing code without altering the code itself. In this...

Pipes and Filters Architectural Pattern in C#

Pipes and Filters Architectural Pattern in C#

As the popular saying suggests, "Divide and Rule", the same principle can be applied in software development. There is an architectural pattern known as "Pipes and Filters", which is used to accomplish just that. The idea is to break down a complex task into smaller...

Read and Write Windows Registry in C#

Read and Write Windows Registry in C#

In this article, we will learn what Windows Registry is, how we can work with it in .NET Core, and how we can read and write Windows Registry in C#. After that, we will explore some advanced use cases of the Windows Registry.  [sc name="github"...

Event-Driven Architecture in C#

Event-Driven Architecture in C#

Event-driven architecture is a powerful pattern for building scalable, responsive, and loosely coupled systems. In this article, we will look into event-driven architecture in C#. We'll explore what the pattern is, its use cases, and its advantages through examples....

Hot Reload in ASP.NET Core Applications

Hot Reload in ASP.NET Core Applications

In this article, we will dive into what hot reload is and how it revolutionizes our development workflow. We will review its features, origins, examples, and most importantly best practices. Let's start. What is Hot Reload Hot reload stands as a transformative feature...

Merging Multiple PDFs Using the iText Library in C#/.NET

Merging Multiple PDFs Using the iText Library in C#/.NET

In this article, we will continue our exploration of the iText library. However, today, we will take a closer look at working with existing files and the process of merging multiple PDFs into a single, comprehensive document. In a previous article on the iText...

How to Force Run .NET Application as Administrator

How to Force Run .NET Application as Administrator

In this article, we will learn how to force run a .NET application as an Administrator. We will do that by modifying the application manifest file of our application to illustrate the whole process. [sc name="github"...

Handling Dates With Noda Time in .NET

Handling Dates With Noda Time in .NET

Handling dates can be confusing, especially when developing an application with time-sensitive data and users across different time zones. That's where Noda Time comes in. In this article, we will learn about handling dates using Noda Time in .NET and streamline our...

How to Build a Query String for a URL in C#?

How to Build a Query String for a URL in C#?

In web development, a query string is a crucial URL component that facilitates data exchange between clients and servers. In this article, we will learn how to build a query string for a URL in C#. [sc name="github"...

Strangler Fig Architectural Pattern in C#

Strangler Fig Architectural Pattern in C#

In this article, we will discuss the use of the strangler fig architectural pattern. While the design can be applied to any programming language, we will focus on C# here.  [sc name="github"...