A man wearing a black and teal tuxedo

When EF Core Isn't Enough: Adding Dapper Without Breaking Your Domain Model

I use EF Core almost exclusively for database access in my .NET projects. For the write side of almost any app, I want an aggregate that protects its own invariants, a repository that hides the database, and a unit of work that commits a transaction. EF Core gives me all of that without much ceremony. So when I say “here’s when I reached for Dapper,” I want to be clear up front: this isn’t a recommendation to replace EF Core, or even to use Dapper regularly. It’s a description of one place where EF Core’s own tools stopped being enough, and the rules I set for myself before I let a second data access library into the codebase. ...

November 3, 2026 · 20 min
Man holding keys

Is Identity GUID or Is It Int?

Introduction I have long waffled on whether a GUID or integer make for the best primary key. I wrote this with the goal of refining or challenging my current opinion. The identity, or primary key, uniquely identifies an entity or record. To be clear, ‘identity’ is a Domain Driven Design concept that describes an immutable identifying attribute of an entity (not to be confused with a SQL Server identity column, which is an automatically incrementing integer). A ‘primary key’ is a database concept that serves the same purpose for a record and enforces referential integrity. In this post, I will use the term ‘primary key’, since we are focusing on the database. The concept of an identity attribute is more than just a database concern, it is a domain concern, but it is important to consider where these concerns intersect. ...

April 19, 2022 · 8 min