Author: Chris Woodruff

htmx + ASP.NET Core Razor Pages Workshop

Stop Building SPAs for Every Screen: htmx + ASP.NET Core Razor Pages Workshop (Open)

If your default move for “modern UX” is a SPA, you are paying a tax you do not need. You pay for it in build pipelines, duplicated validation rules, fragile client state, and a front end that turns routine CRUD into an engineering project. This workshop is a different bet. We keep the server in charge, keep HTML as the …

Continue Reading
Enterprise Patterns for ASP.NET Core: Front Controller and MVC Pattern

Enterprise Patterns for ASP.NET Core: Front Controller and MVC Pattern

If every controller in your system does its own authentication, logging, and error handling, you do not have an architecture. You have a crowd of small frameworks pretending to cooperate. Front Controller and MVC are the patterns that push back against that drift. In ASP.NET Core, the pipeline and routing already give you a natural front controller. The real question …

Continue Reading
Enterprise Patterns for ASP.NET Core Minimal API: Identity Map Pattern

Enterprise Patterns for ASP.NET Core Minimal API: Identity Map Pattern

If one customer quietly turns into three different in-memory objects during a single request, your domain is already lying to you. You see it when: The Identity Map pattern exists to stop this drift. It gives you a single rule: Within a Unit of Work, there should be exactly one in-memory object per database identity. In other words, one row, …

Continue Reading
Enterprise Patterns for ASP.NET Core Minimal API: Unit of Work Pattern

Enterprise Patterns for ASP.NET Core Minimal API: Unit of Work Pattern

If a single business operation calls SaveChangesAsync three times, you do not have a transaction. You have a sequence of partial commits that you hope never fails in the middle. Think about a typical “Place Order” flow: In many codebases, each step touches persistence on its own schedule. A service somewhere calls SaveChangesAsync. Another service does the same. A helper …

Continue Reading
Enterprise Patterns for ASP.NET Core Minimal API: Repository Pattern

Enterprise Patterns for ASP.NET Core Minimal API: Repository Pattern

If DbContext shows up in every corner of your codebase, you do not have a domain model. You have a thin layer of LINQ wrapped in HTTP. You see it when: A tiny change in schema or query behavior then turns into a scavenger hunt across controllers, services, and helpers. The Repository pattern exists to stop that. A repository gives …

Continue Reading
Enterprise Patterns for ASP.NET Core Minimal API: Data Mapper Pattern

Enterprise Patterns for ASP.NET Core Minimal API: Data Mapper Pattern

If every interesting class in your system secretly knows a connection string, your domain is not a model. It is a thin layer of code on top of a data access layer. You see it when: At that point, changing a column name feels risky. Changing an important rule feels worse because it’s tangled with SQL and infrastructure. The Data …

Continue Reading
Enterprise Patterns for ASP.NET Core Minimal API: Active Record Pattern

Enterprise Patterns for ASP.NET Core Minimal API: Active Record Pattern

Sometimes, your domain is really just rows in a table. You have a Customers table with Id, Email, and CreditLimit.You load a row, tweak a field, and write it back.That is the whole story. In that situation, introducing a complete Domain Model, Data Mapper, and Repository stack can feel like ceremony for ceremony’s sake. The Active Record pattern exists for precisely this scenario: when your object and …

Continue Reading
Debugging Entity Framework Core: 8 Real-World Query Anti‑Patterns

Debugging Entity Framework Core: 8 Real-World Query Anti‑Patterns (and How to Fix Them)

This is my post for the 2025 C# Advent. Check out all the great posts! I want to wish you a Merry Christmas, Happy Holidays, Happy Hanukkah, Happy Kwanzaa, and, finally, Happy Festivus. I will not be sharing my “Airing of grievances” or challenge anyone to a “Feats of strength.” Entity Framework Core is an excellent library for CRUD operations against …

Continue Reading
Service Layer: Making HTTP a Client, Not the Boss

Enterprise Patterns for ASP.NET Core Minimal API: Service Layer Pattern – Making HTTP a Client, Not the Boss

Open a typical ASP.NET Core project, and you will often see the same shape: If you have ever tried to add a second client (a background worker, a message handler, or a gRPC API), you probably copied a large chunk of controller logic and hoped no one noticed. The Service Layer pattern exists to stop that. Instead of letting controllers …

Continue Reading