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....
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...
Improve Entity Framework Core Performance with Complex Types
In this article, let's explore what Complex Types are in Entity Framework Core and how we can use them to improve the performance of our .NET applications. [sc name="github"...
How to Find All the Positions of a Substring in Another String in C#
In this article, we are going to learn how to find all the positions of a substring in another string. So we are trying to find, for...
How to Read appsettings.json in a .NET Console Application
In this article, we will learn how to read appsettings.json in a .NET console application. Explanation Of appsettings.json The appsettings.json file in .NET applications serves as a centralized repository for configuration settings, utilizing the JSON format for its...
Bridge Design Pattern in C#
In this article, we are going to talk about a structural design pattern, the Bridge Pattern. We will discuss what problem this pattern solves and how to implement it in C#. [sc name="github"...
Local Functions vs Lambda Expressions in C#
In this article, we'll discuss the differences between local functions and lambda expressions in C#. Let's...
Conditionally Add Middleware in ASP.NET Core
In this article, we'll explore different techniques on how to conditionally add middleware in ASP.NET Core applications. Let's start!...
Multitenancy in .NET With Orchard Core
Orchard Core, a multipurpose open-source platform built upon ASP.NET Core, offers strong support for multi-tenancy. This article explores the installation and configuration of Orchard Core for multitenancy .NET applications, as well as the setup of multitenancy...
Proxy Design Pattern in C#
In this article, we are going to talk about a structural design pattern, the Proxy Pattern. We will discuss what problem this pattern solves and how to implement it in C#. [sc name="github"...
Working With Semaphore Class in C# and Best Practices
In this article, we'll introduce the semaphore class in C#. We'll compare the semaphore and semaphoreSlim classes and discuss the best practices for using semaphores. [sc name="github"...
What Does the null! Statement Do?
In this article, we are going to discuss the null! statement in C#. First, we will explore its construct, and function in our programs. Then, we will examine various situations where we can use this statement in our applications. [sc name="github"...
How to Use FakeLogger to Test Logging Code in .NET
In software development, logging, and unit testing serve as foundational tools, each actively contributing to the reliability and functionality of our applications. While unit testing promptly alerts us to changes in our application's business logic, logging actively...
How to Ignore a Property in AutoMapper
In this article, we will explore key techniques to ignore property in AutoMapper. We will use the Ignore() method, the Ignore attribute, and the DoNotValidate() method. We will also discuss when and how to use each of the methods mentioned. [sc name="github"...