Latest Posts On Code Maze

Cancellation Tokens with IAsyncEnumerable

Cancellation Tokens with IAsyncEnumerable

This article will remind us what cancellation tokens are and how to use them in C#. After that, we are going to talk about how we can use them with the IAsyncEnumerable interface and the cases when we should be careful while using them. To download...

Difference Between “throw” vs “throw ex” in C#

Difference Between “throw” vs “throw ex” in C#

In this article, we are going to discuss a subtle, but hugely important subject - the difference between throw and throw ex.  Understanding this simple distinction might save a significant amount of debugging time and stress. To download the source...

Dependency Injection Lifetimes in ASP.NET Core

Dependency Injection Lifetimes in ASP.NET Core

While registering our services in the ASP.NET Core DI container, we can configure them with different lifetimes. In this article, we are going to talk about the different dependency injection lifetimes.  To download the source code for this...

C# Delegates

C# Delegates

In this article, we're going to talk about C# delegates, which are a prerequisite for learning events-based programming. Delegates are one of the fundamental building blocks of flexible applications, as they can be found in the vast majority of .NET framework code...

.NET Collections – IEnumerable, IQueryable, ICollection

.NET Collections – IEnumerable, IQueryable, ICollection

In this article, we are going to discuss three popular interfaces in the area of .NET collections. We all use collections every day in .NET, but do we really understand the difference between each of them, and when we should use one or another? Hopefully, at the end...

Google Sheets API with .NET Core

Google Sheets API with .NET Core

In this article, we’re going to explore the Google Sheets API using the Google Sheets Client Library for .NET. We’ll start with configuring the Google Sheets API in the Google developer console. Then we'll build an ASP.NET Core application that can read and write data...

IAsyncEnumerable with yield in C#

IAsyncEnumerable with yield in C#

The support for Async Streams was one of the most exciting features that came out with .NET Core 3.0 and C# 8. This is possible with the use of IAsyncEnumerable with the yield operator. In this article, we are going to explore how to take advantage of this new feature...

Code Coverage in .NET

Code Coverage in .NET

In this article, we are going to explore the topic of code coverage in .NET and look at what tools we can use to understand and improve code coverage in the software we build. To download the source code for this article, you can visit our Code...

Events in C#

Events in C#

Events in C# are a mechanism that classes use to send notifications or messages to other classes. They are a specialized delegate type that we use to notify other classes when something they listen to happens. Events are a vital part of many applications, and a...

Azure Table Storage with ASP.NET Core

Azure Table Storage with ASP.NET Core

In this article, we are going to learn about Azure Table Storage in depth. We’ll start by discussing the basic Azure Table Storage concepts and then see how to create an Azure Storage Account from the portal. After that, we’ll learn how to create an ASP.NET Core Web...

Writing Logs to SQL Server Using NLog

Writing Logs to SQL Server Using NLog

We have previously learned how to log messages to a File using NLog. In this article, we are going to learn how to use Nlog to log messages into SQL Server. We are going to see how we can configure an ASP.NET Core Web API project to support NLog and how we can...

Azure Queue Storage with ASP.NET Core

Azure Queue Storage with ASP.NET Core

In this article, we are going to learn Azure Queue Storage in depth. We’ll start with some introductory stuff about Azure Storage Queue and look at how to create one from the Azure Portal. After that, we’ll see how to build and deploy applications that can send and...

Dapper Migrations with FluentMigrator and ASP.NET Core

Dapper Migrations with FluentMigrator and ASP.NET Core

In this article, we are going to show you how to use the FluentMigrator library to create data migrations with Dapper and ASP.NET Core. In our previous article, where we learned a lot about Dapper and ASP.NET Core, we had to create our database and seed our data...

Azure BLOB Storage with ASP.NET Core and Angular

Azure BLOB Storage with ASP.NET Core and Angular

In this article, we are going to take a look at the Azure Storage Platform and learn how to work with Azure BLOB Storage. We’ll start with an introduction to the Azure Storage Platform. Then, we’ll look at the different types of storage services that Azure offers....

Onion Architecture in ASP.NET Core

Onion Architecture in ASP.NET Core

In this article, we are going to learn about Onion architecture and what are its advantages. We will build a RESTful API that follows the Onion architecture, with ASP.NET Core and .NET.  The Onion architecture is also commonly known as the “Clean architecture” or...