Mediator Design Pattern in C#
 In this article, we are going to talk about a popular design pattern, the Mediator Pattern. We will see how this pattern helps address some design problems and how to implement it in C#. [sc name="github"...
Manage Background Tasks With The IHostedLifecycleService Interface
In this article, we’ll describe the IHostedLifecycleService interface. We'll see how it extends the IHostedService interface and enables finer control over the hosted service lifecycle. Finally, we'll show some practical use cases for the IHostedLifecycleService...
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...
Load Testing ASP.NET Core Web API With JMeter
In this article, we will learn how to load test an ASP.NET Core Web API with JMeter. So let's get going. Introduction to JMeter Load testing is...
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
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"...
Dynamically Change the ServiceLifetime of a Registered Service in .NET
Managing dependencies is essential in modern application development. .NET provides a powerful Dependency Injection (DI) system, with ServiceCollection at its core. Typically, we register a service and use it as is. However, there are instances when we need to change...
Differences Between Record Struct and Record Class in C#
In this article, we'll discuss the differences between record struct and record class in C#. First, we will shortly explain each of the types. Afterward, we'll show and describe each difference between them. [sc name="github"...
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...
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....
What are the Differences Between Onion Architecture and Clean Architecture in .NET?
In this article, we are going to discuss the differences between onion architecture and clean architecture in .NET. These patterns are often used interchangeably, and while they are very similar, there are some key differences that we will highlight. [sc name="github"...
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
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#
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#
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...
Multi-Source Data Integration With Strawberry Shake Subscriptions
When we need multi-source data integration, Strawberry Shake allows us to wire up GraphQL with Subscriptions to implement a pub-sub system. [sc name="github"...
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
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
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...
Generate Images Using OpenAI in an ASP.NET Core Application
In this article, we are going to explore how to generate images in an ASP.NET Core application using OpenAI. Let's get going....