EF Core Compiled Queries: Complete Guide, Patterns, and Performance
Learn how to use EF Core compiled queries to boost performance in .NET applications. Includes real-world patterns, benchmarks, and practical tips.

C# 14 Extension Members: Cleaner Code
The era of the ‘Helper Class’ is over. C# 14 introduces Extension Members, allowing you to add properties, operators, and static methods to external types. Here is how to modernize your codebase.

Avoid Anemic Domain Models
Stop writing C# classes that are just data bags. An anemic domain model scatters your business logic, leading to bugs and maintenance nightmares. Here’s how to fix it.
The Real Difference Between Domain and Application Layer in Clean Architecture
I’ve lost count of how many times I’ve seen developers struggle with this question: “Should this logic go in the Domain layer or the Application layer?” Clean Architecture diagrams make it look simple, but when you’re staring at your actual codebase, the lines blur fast. You know the situation. You’ve got a business rule to implement. You open your project, see both folders, and pause. Put it in the wrong place, and six months later you’re wrestling with a mess of tangled dependencies and logic that’s impossible to test. ...

Stop Asking Your Objects Questions. Just Tell Them What to Do
The ‘Tell, Don’t Ask’ principle helps reduce behavioral dependencies in C# applications by keeping decision-making logic inside the objects that own the data. This leads to cleaner, more maintainable code with better encapsulation and reduced coupling.
Integration Testing ASP.NET Core APIs The Right Way with WebApplicationFactory
A comprehensive guide to integration testing ASP.NET Core APIs with WebApplicationFactory. Learn to replace real databases, mock services, test authenticated endpoints, and build production-ready test suites.

Building Maintainable EF Core Repositories Without Generic Hell
Most EF Core projects start with a generic repository that soon turns into a mess of type parameters and leaky abstractions. In this post, learn how to design maintainable, aggregate-specific repositories that are clean, testable, and production-ready.

Implement CQRS in ASP.NET Core Without MediatR
If you’ve worked with modern ASP.NET Core, you’ve almost certainly encountered MediatR. It’s a fantastic library, and for good reason; it has become the de-facto standard for implementing the CQRS pattern in .NET, helping you build clean, decoupled, and maintainable applications. But have you ever paused to look behind the curtain? In my experience building several lean microservices, I’ve found that while MediatR is a go-to, there are times when a simpler, handcrafted approach is more effective. This post is born from that experience. ...
How to Structure Your ASP.NET Core API for Clean Testing
A practical guide to structuring ASP.NET Core APIs for reliable integration and unit testing using clean architecture principles and minimal, production-ready C# code.
Optimistic vs. Pessimistic Concurrency in EF Core: A Conceptual Deep Dive
EF Core’s default optimistic concurrency model is a great starting point, but it’s not a silver bullet. When write contention heats up, its limitations can lead to performance bottlenecks and data integrity challenges. Understanding the trade-offs between optimistic and pessimistic concurrency is crucial for building robust, scalable applications. This article explores the conceptual costs and benefits of each strategy, helping you decide when to stick with the default and when to reach for explicit locking. ...