Latest Posts On Code Maze

How to Check if StringBuilder Is Empty

How to Check if StringBuilder Is Empty

In this article, we’re going to talk about the StringBuilder class, and explore options to check if it is empty, directly or indirectly. So, let's start. What...

How to Run Code in a New Thread in C#

How to Run Code in a New Thread in C#

In this article, we are going to learn how to run code in another thread in C#. There are many ways to do it in .NET, but we are going to focus on a basic, modern approach.  To download the source code for this article, you can visit our GitHub...

Code Maze Weekly #105

Code Maze Weekly #105

Issue #105 of the Code Maze weekly. Check out what's new this week and enjoy the read. .NET and C# .NET 6 Has Arrived: Here Are A Few of My Favorite Things [daveabrock.com] What's your favorite thing in .NET 6? Fastest way to enumerate a List<T>...

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...

Code Maze Weekly #104

Code Maze Weekly #104

Issue #104 of the Code Maze weekly. Check out what's new this week and enjoy the read. .NET and C# Modernize WinForms and WPF apps with BlazorWebView [danielhindrikes.se] With BlazorWebView you can host Blazor inside of your native app, in the same process as the rest...

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...

Code Maze Weekly #103

Code Maze Weekly #103

Issue #103 of the Code Maze weekly. Check out what's new this week and enjoy the read. .NET and C# A .NET 5.0 Guide: From Idea To NuGet Package [khalidabuhakmeh.com] A step-by-step guide to getting your code published to NuGet by Khalid Abuhakmeh. What’s New in C# 10:...

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...

Code Maze Weekly #102

Code Maze Weekly #102

Issue #102 of the Code Maze weekly. Check out what's new this week and enjoy the read. Next week we'll be starting BLACK FRIDAY offers a bit earlier. If you've planned to get some of our materials, this will be the best offer the...

Code Maze Weekly #101

Code Maze Weekly #101

Issue #101 of the Code Maze weekly. Check out what's new this week and enjoy the read. .NET and C# Bite-Size .NET 6 - UnionBy, IntersectBy, ExceptBy, and DistinctBy [exceptionnotfound.net]  .NET 6 includes a new set of methods in the LINQ library to help us work with...

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...

Code Maze Weekly #100

Code Maze Weekly #100

Issue #100 of the Code Maze weekly. Check out what's new this week and enjoy the read. .NET and C# A quick review of C# 10 new language features [thomaslevesque.com] An excellent way to prepare for the release of .NET 6 and C# 10 that's around the corner. Let's go...

.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...

Code Maze Weekly #99

Code Maze Weekly #99

Issue #99 of the Code Maze weekly. Check out what's new this week and enjoy the read. .NET and C# The Hot Reload Debacle [dotnetcoretutorials.com] There has been some drama regarding the hot reload functionality and dotnet watch this week. We think it's important to...

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...

Code Maze Weekly #98

Code Maze Weekly #98

Issue #98 of the Code Maze weekly. Check out what's new this week and enjoy the read. .NET and C# Bulk Import Records Into SQLite With C# [khalidabuhakmeh.com] Seeding SQLite with EF Core can be useful in many scenarios in real life like quick demos and presentations....

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 Maze Weekly #97

Code Maze Weekly #97

Issue #97 of the Code Maze weekly. Check out what's new this week and enjoy the read. .NET and C# Add new endpoint to ASP.NET Core application Runtime using API Framework [mikaelkoskinen.net] Interesting read by Mikael Koskinen on how to add new endpoints to the...

CQRS Validation Pipeline with MediatR and FluentValidation

CQRS Validation Pipeline with MediatR and FluentValidation

In this article, we are going to show you how to elegantly integrate a validation pipeline into our project using the MediatR and FluentValidation libraries. As .NET 6 is around the corner (November) this is a great opportunity to explore some of the new...