Search for a command to run...

A list of orders in memory, rows streaming out of a database, pages from an API - from the consumer's side they are the same question: give me the next item, and tell me when there are no more. The Iterator pattern is that question answered as an interface pair, and in .NET it is the shape of foreach and LINQ themselves: hand-built enumerators, yield return, deferred execution, and the async twin IAsyncEnumerable<T> - including the costs, and when a List is the honest answer.

An order is placed, and five parts of the system need to know. The Observer pattern flips who knows about whom: the publisher announces one fact, subscribers come and go, and the publisher never changes. From hand-built subjects to C# events, IObservable<T>, and MediatR notifications - with the push and pull models demonstrated in code - including the costs, and when a direct call is the honest answer.

A price is not a decimal, a phone number is not a string, and an email is not a string either. Primitive obsession is the habit of modelling domain concepts with the language's built-in types β and value objects are the small, boring, enormously effective fix.

Your order is saved but the confirmation email never goes out β and nothing failed. The Outbox pattern fixes that class of bug by writing the message and the business change in the same database transaction, then letting a background relay handle delivery.

For a small query on a hot path, EF Core can spend as much time translating the LINQ query as the database spends executing it. Compiling that query once removes the repeated translation β no schema change, no new dependency, and no result caching involved.

My blog's admin area is guarded twice: better-auth sessions in the browser, JWT Bearer on the API, and one small exchange route between them. This is the real setup, with the journeys and the trade-offs.

I've shipped CQRS with MediatR in two real systems β and deliberately left it out of a third. Then I pointed my own CQRS mapping tool at this blog, and it showed me where my pipeline was bluffing.

Inside the API from Part 1: an ASP.NET Core 8 backend in Clean Architecture and CQRS β 63 requests, 63 handlers, one validation pipeline β and the real handler code that serves every post on Hakim.

When you open abdullahhakim.me, your request crosses Cloudflare, a Next.js frontend on Vercel, a tunnel into a small server I run myself, and an ASP.NET Core API backed by PostgreSQL and Redis. This post traces that exact path β the real one, as it runs today.