Code Maze Author

Božo Špoljarić

Božo Špoljarić has been a developer for 20 years. Last ten years, he has been working primarily in .NET and the last few years exclusively. He writes educational texts as part of his start-up business, but also as a hobby and point of interest.
Also find me here:

MY ARTICLES:

Hybrid Caching in ASP.NET Core

In this article, we'll introduce hybrid caching in .NET, a new cache type that bridges the existing cache mechanisms in .NET: distributed cache and memory cache. We'll start by briefly explaining a cache and how existing caches in .NET work. After that, we'll explore...

Persist Values With AsyncLocal in C# Async Flow

In this article, we'll explain the AsyncLocal class and how to persist values across an async flow with the AsyncLocal class in C#. We'll start by describing the challenge that AsyncLocal solves and continue with examples of how it does that. We'll scratch the surface...

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

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

Span vs Memory in C#: Which Should We Use?

Use Span<T>. It is faster, it never allocates, and it is the right parameter type for any synchronous method that reads or writes a buffer. Reach for Memory<T> only where Span<T> cannot go. Span<T> is a ref struct, so it cannot be a field in a...

New Features in C# 12

In this article, we will explore new features in C# 12. We will describe primary constructors, collection expressions, inline arrays, and other newly introduced features.  We'll need the latest Visual Studio 2022 or .NET 8 SDK to try each of these new C# 12 features,...