Page 2 of 6
Expression Trees in C#
Lambda expressions in C# do double duty. Most of the time they're just delegates — compiled functions you call directly. But when assigned to Expression<TDelegate>, they become data: a tree of objects...
Cancellation Tokens in C#
Async code doesn't run forever in a vacuum. Users cancel requests, clients disconnect, timeouts fire, and applications shut down. Without a way to signal that a running operation should stop, you end ...
Frozen Collections in .NET
Most collections in .NET are designed for mutation. You add items, remove them, update values. But there's a whole class of data that never changes after it's been set up — configuration lookups, coun...
Concurrent Collections in .NET
Threading bugs are some of the nastiest bugs to track down. They appear intermittently, vanish under the debugger, and tend to manifest in production at the worst possible time. One common source of t...
TCR for Agentic Loops: Guiding LLM Agents
The TCR post on this blog showed how test && commit || revert forces human developers to take smaller steps by making the machine enforce discipline. But what happens when the "developer" is an autono...
TCR: Test && Commit || Revert in C#
If you've read the TDD post on this blog, you know the red-green-refactor loop: write a failing test, make it pass, clean up. TCR takes that idea and cranks it up to eleven. Instead of a discipline yo...
Dapper: Lightweight SQL in .NET
Entity Framework Core is great for a lot of scenarios, but sometimes you just want to write SQL and get results back without the overhead. That's where Dapper comes in. It's a micro-ORM — essentially ...
EF Core Performance Tips in .NET
Entity Framework Core is fantastic for getting database access up and running quickly. But if you're not careful, it can quietly generate some impressively inefficient SQL. The good news: most EF Core...
Vertical Slice Architecture
If you've spent time working in layered architecture — controllers, services, repositories, all the way down — you've probably felt the friction. Adding a feature means touching four or five layers, t...
Event Sourcing in .NET
Yesterday we looked at CQRS, which separates reads from writes. Today's topic pairs naturally with it: event sourcing. Instead of storing the current state of your entities, you store the sequence of ...
CQRS with MediatR in .NET
Most APIs start out simple: a controller calls a service, the service calls a repository, done. But as apps grow you end up with fat service classes doing everything — reading, writing, validating, or...
API Versioning in ASP.NET Core
APIs grow. Endpoints change shape, fields get renamed, response contracts evolve — and at some point you need to make a breaking change without destroying every existing client that depends on the old...
Real-Time Web Apps with SignalR
Most web apps follow a simple pattern: the client asks, the server answers. That works great for fetching a list of orders or loading a profile page. But what about a live dashboard, a chat app, or no...
Authentication and Authorization in ASP.NET Core
If you're building any real ASP.NET Core app, you'll hit this question quickly: "How do I lock this down without making everything painful?"
Authentication and authorization sound similar, but they so...
Using Json.NET in ASP.NET Core on .NET 10
ASP.NET Core has shipped System.Text.Json as its default serializer since .NET Core 3.0. It's fast, it's trim-safe, and it keeps getting better. But Json.NET (Newtonsoft.Json) is still everywhere — in...