CQRS, ArrayPool and C# Switch Safety
Explore one-database CQRS with EF Core, pooled arrays for fewer allocations, compiler warnings for switch expressions, and a runnable architecture lab.
Jasen's top three picks
- 1 CQRS in ASP.NET Core: Why I Prefer Starting with One Database Instead of Two
C# Corner
Learn how to implement CQRS in ASP.NET Core with separate command and query models while using one EF Core and SQL Server database.
- 2 ArrayPool
in C#: Reducing Allocations Without Writing Unsafe Code Medium
Every time we create an array in C#, we allocate memory. For example:
- 3 Clean Architecture, DDD, CQRS and Microservices in One Runnable .NET Lab
Medium
A small C# system you can clone, run with dotnet run, and read in an afternoon. No database, no broker, no Docker.
Editor's note
I picked a varied mix of C# and architecture reads today. The single-database CQRS walkthrough offers a manageable starting point, while the ArrayPool article looks at reducing allocations without unsafe code.
Today's articles
CQRS in ASP.NET Core: Why I Prefer Starting with One Database Instead of Two
C# Corner
Learn how to implement CQRS in ASP.NET Core with separate command and query models while using one EF Core and SQL Server database.
Topics: ASP.NET Core CQRS EF Core
Read article ArrayPool in C#: Reducing Allocations Without Writing Unsafe Code
Medium
Every time we create an array in C#, we allocate memory. For example:
Topics: C# Performance
Read articleClean Architecture, DDD, CQRS and Microservices in One Runnable .NET Lab
Medium
A small C# system you can clone, run with dotnet run, and read in an afternoon. No database, no broker, no Docker.
Topics: Clean Architecture CQRS Domain-Driven Design
Read articleWriting Safer Switch Expressions in C# With Compiler-Checked Cases
C# Corner
Learn how C# switch expressions handle missing cases, compiler warnings such as CS8509, enum fallbacks, and exhaustive pattern matching for safer code.
Topics: C#
Read articleC# 15: Practical Features Every .NET Developer Should Know
Medium
Explore union types, closed hierarchies, and cleaner collection syntax with small examples.
Topics: C#
Read articleAt Least K Occurrences Using C# – Dictionary / HashMap
C# Corner
Learn how to find the first array element whose k-th occurrence appears earliest using a C# Dictionary for frequency counting, with O(n) expected time complexity.
Topics: C#
Read article