#592 – January 25, 2026
using reflection and dynamic methods
Making foreach on an IEnumerable allocation-free using reflection and dynamic methods
17 minutes by Andrew Lock
Andrew explains how to reduce memory allocations when using foreach loops in C#. The problem occurs because when you store a collection as an IEnumerable interface, the struct enumerator gets boxed to the heap, causing 40-byte allocations. Andrew presents a solution using Reflection.Emit to create dynamic methods that call the struct enumerator directly. This technique eliminates allocations on older .NET versions but becomes unnecessary in .NET 10, which automatically optimizes these scenarios.
Result pattern in C#
6 minutes by Adrian Bailador
Adrian shows how to implement the result pattern for cleaner error handling without exceptions. He describes when to use it, how to build it from scratch, and integrate it with ASP.NET Core Minimal APIs.
ArrayPool: The most underused memory optimization in .NET
7 minutes by Vladamisici
ArrayPool is a powerful but rarely used .NET feature that greatly improves performance by reusing arrays instead of allocating new ones. This reduces memory usage, avoids costly garbage collection, and boosts throughput, especially for large or frequent allocations.
Solving message ordering from first principles
7 minutes by Milan Jovanović
Systems don't need global message ordering. They need events handled in order per aggregate. This leads to building workflows called sagas. Domain events work well but become brittle during integration. The outbox pattern fixes reliability by storing events in the same transaction. However, competing consumers break ordering when scaling. The solution evolves from single consumers to choreographed sagas to orchestrated state machine sagas for better control.
How we synchronize .NET’s virtual monorepo
36 minutes by Přemek Vysoký
Microsoft overhauled .NET's build process by creating the virtual monolithic repository. This single repository combines source code from dozens of separate product repositories. The repository uses two-way synchronization with git patches to keep changes flowing between the main and individual product repositories. The system now builds .NET SDK from one commit instead of combining artifacts from multiple sources, making the process simpler and more reliable.
And the most popular article from the last issue was: