Latest Posts On Code Maze

SIMD Accelerated Numeric Types in C#

SIMD Accelerated Numeric Types in C#

In this article, let's explore the various SIMD (Single Instruction, Multiple Data) accelerated numeric types in .NET. We'll start by examining what SIMD stands for and how it works in .NET. Then, we'll look at the different SIMD accelerated numeric types available in...

StringValues in ASP.NET Core

StringValues in ASP.NET Core

When developing web applications using ASP.NET Core, we frequently encounter scenarios where we need to manage collections of strings. These collections can originate from various sources, such as HTTP headers, query strings, form data, and configuration settings....

How to Implement Log4net in C#/.NET

How to Implement Log4net in C#/.NET

In this article, we will learn how to implement Log4net, a logging framework for C# applications, and how to use it effectively. Knowing how to log properly helps us to be more efficient while debugging, monitoring, and maintaining our applications. [sc name="github"...

Advanced Debugging in C#

Advanced Debugging in C#

In this article, we'll be talking about advanced debugging and inspecting data in C#. We'll be using Visual Studio 2022 to demonstrate all the debugging techniques. For more information about general debugging, we have another article on the basics of debugging, so...

Wolverine in .NET: Lightweight Messaging and CQRS

Wolverine in .NET: Lightweight Messaging and CQRS

Wolverine is a .NET framework that works as both an in-process mediator (the role MediatR plays) and a full asynchronous messaging framework with RabbitMQ, Azure Service Bus, Amazon SQS, and Kafka transports (the role MassTransit plays). Handlers are plain methods, no...

Run a Large Language Model(LLM) Like ChatGPT Locally With C#

Run a Large Language Model(LLM) Like ChatGPT Locally With C#

We are quickly entering the era of AI in Tech and software development. AIs are no longer relegated to research labs. More recently, we have gained access to using AI on the web and even on our personal devices. Now, we can run AIs locally on our personal computers....

Implementing the Saga Pattern Using Rebus and RabbitMQ

Implementing the Saga Pattern Using Rebus and RabbitMQ

In this article, we provide a technical guide on implementing the Saga Pattern using Rebus and RabbitMQ in a .NET environment. Rebus is a .NET library designed to create distributed applications with messaging capabilities, simplifying the process of sending and...

How to Cancel an HTTP Request on Leaving a Blazor Component

How to Cancel an HTTP Request on Leaving a Blazor Component

This article explores how to cancel an HTTP request and the associated backend operation inside a Blazor component. After a brief introduction to the architecture for canceling backend operations, we will familiarize ourselves with cancellation tokens and how to...

Template Method Design Pattern in C#

Template Method Design Pattern in C#

In this article, we will talk about a behavioral design pattern, the Template Method Pattern. We are going to see how this pattern helps deal with certain design problems and how to implement it in C#. [sc name="github"...

The LINQ Where Method in C#

The LINQ Where Method in C#

In this article, we'll focus on the use cases of the LINQ Where Method in C#. The LINQ Where Method offers a powerful tool that can manipulate data from...

How to Convert a Stream to a File in C#

How to Convert a Stream to a File in C#

In this article, we'll discuss how to convert a stream to a file in C#. We will demonstrate different ways to do that, discuss the advantages and disadvantages of each, and see when one way could be more suitable.   [sc name="github"...

How to Test IServiceCollection Registrations in .NET

How to Test IServiceCollection Registrations in .NET

Unit testing IServiceCollection registrations in .NET enables us to test our application's IServiceCollection to confirm that the setup of dependency injection is correct, allowing us to catch errors early in development. E.g. if we fail to register a service or...

Using EF Core Interceptors in .NET

Using EF Core Interceptors in .NET

Entity Framework Core (EF Core) has many powerful features, with Interceptors being one of the most versatile. Interceptors allow us to plug in custom behavior at different stages of the EF Core operation pipeline, giving us enhanced control over data interaction...

Abstract Factory Design Pattern in C#

Abstract Factory Design Pattern in C#

The Abstract Factory design pattern is a creational pattern that handles object instantiations. It offers a framework to manage complex object creation scenarios and helps us achieve a more maintainable code structure. In this article, we'll look into the Abstract...