Performance Testing of ASP.NET Core APIs With k6
In this article, we are going to discuss how to do ASP.NET Core Performance Testing, specifically with the open-source tool k6. We'll cover the need for performance testing, how to get the best results, and then dive into some examples of how k6 can help. [sc...
Path Class in C#
When we want to perform operations on path strings containing file or directory path information, the best choice is to call the built-in C# Path Class methods. This class comes under the System.IO namespace and System.Runtime.dll assembly. In this article, we are...
What is .NET – Why Should We Use It, and What Can We Do With It
In this article, we are going to learn about .NET and its capabilities. We'll see what .NET is, what different application models .NET supports, why should we use it, and some limitations. So let's get going. What is .NET? .NET is a free, cross-platform, open source...
What is the Difference Between a DTO and a POCO?
In this article, we are going to learn the differences between a DTO (Data Transfer Object) and a POCO (Plain Old CLR/C# Object). We use these types of objects in everyday coding. However, we are often not sure what the real differences are. We are going to dive...
How to Read AppSettings Values From a JSON File in .NET Core
In this post, we are going to learn how to read AppSettings values from a JSON file in ASP.NET Core. Let's start. [sc name="videolink"...
Counting Occurrences of a Char Within a String in C#
In this article, we are going to learn how to count occurrences of a char within a string in C#. A string is a sequence of characters and we essentially iterate over it to count the number of occurrences of any character within it. [sc name="github"...
How to Use Shouldly to Improve Unit Tests in .NET?
In this article, we are going to explore Shouldly. Shouldly is a library that improves the quality of our tests. Before seeing this library in...
Using Query String Parameters with Minimal APIs
In this article, we are going to explain how we can work with query string parameters in Minimal APIs in .NET 6. You may refer here for a nice introduction to the concept of Minimal APIs. Also, we will show new improvements that .NET 7 brings to the table. [sc...
AutoMapper vs Mapster in .NET
Mapster wins this comparison for most new projects: it is faster in almost every scenario we benchmark below, needs less configuration for common cases, and remains MIT-licensed with no conditions attached. AutoMapper changed its licence at version 15.0.0 in July 2025...
What is NullReferenceException in C#?
In C#, a NullReferenceException occurs when we try to access a variable whose value has not been set or has been set to null. It can be easy to trigger this exception accidentally, so it's important to be aware of how to avoid it in the first place. In this article,...
FileSystemWatcher in C#
.NET provides a handy way to deal with monitoring different file system changes. In this article, we will discuss what FileSystemWatcher is, how to set it up, and how to configure it to observe various file system changes. In addition, we will take a look at the...
Indexers in C#
In this article, we are going to learn about Indexers in C#, how to declare them in a class, struct, or interface, and overload them. We're also going to learn what the differences between indexers and properties are. [sc name="github"...
Return File in ASP.NET Core Web API
In this article, we are going to learn how to return a file in an ASP.NET Core Web API and some concepts behind it. That said, we are going to implement a simple Web API to read a local file and return this file to download. [sc name="patreon-source-code"...
Improving Unit Tests with Fluent Assertions
Unit tests are usually a must-have part of building and maintaining a software application. Fluent Assertions is a wonderful library of extension methods. Due to the nature of the library, the code reads like a written sentence. In this article, we will review many...
Filtering Results Using Filtered Include Method in EF Core
In this article, we are going to learn about Filtered Include in Entity Framework Core, what operations it supports, and what are its use cases. [sc name="github"...
Feature Flags in ASP.NET Core
Being able to conditionally enable or disable features in our applications without redeploying our code is a powerful tool that we can take advantage of to quickly iterate on new features in our applications. In this article, we are going to learn about Feature Flags...
Any() vs Count() in C#: Which One Is Better?
To check whether a collection has anything in it, use Any(). It stops at the first element; Count() may walk the whole sequence to produce a number we then throw away. The exception is a List<T>, an array, or anything else with a Count or Length property. Those...
How to Test a REST API with .NET and xUnit
In this article, we are going to cover how and why we should test a REST API with .NET and xUnit. We'll discuss why this is important, and how to actually test various components of an API response to ensure requirements are being met. [sc name="github"...
Mapster in ASP.NET Core: Getting Started
Mapster is a convention-based object mapping library for .NET: one Adapt<TDestination>() call copies a Person into a PersonDto with zero configuration when property names match. It is MIT-licensed with no conditions attached, and faster than AutoMapper in most...
Using Generics in C#
Generic programming is a powerful tool that C# offers to developers. In this article, we'll take a look at how generics work in C# and some of the benefits they provide. We'll also see how to use generics with classes, methods, and delegates. Finally, we'll look at...
Web API Return Types in ASP.NET Core
In this article, we are going to learn about different return types that we can use with ASP.NET Core Web API controller actions. So let's start...



