Let’s stop pretending.
The Repository Pattern has been a staple of .NET development for years, promising abstraction and testability. But with Entity Framework Core (EF Core) evolving rapidly, is this pattern still relevant—or just unnecessary ceremony? In this post, I’ll argue that for most modern applications, EF Core’s capabilities render the Repository Pattern obsolete. Agree or disagree? Read on and let’s debate.
In 2025, if you’re still wrapping EF Core with a UserRepository that does nothing but call DbContext.Users, you’re not adding value—just ceremony.
You’re not writing a “pattern.” You’re adding friction.
EF Core provides everything the Repository Pattern promises—and more:
Compare this:
// The "classic" repository pattern
public class UserRepository : IUserRepository {
private readonly MyDbContext _ctx;
public UserRepository(MyDbContext ctx) => _ctx = ctx;
public Task<List<User>> GetAllAsync() => _ctx.Users.ToListAsync();
}
To simply:
// Using EF Core directly
await dbContext.Users.ToListAsync();
Which adds more value?
Most repositories today are glorified .ToListAsync() wrappers—adding zero value while actually hiding EF Core’s power and flexibility.
Let EF Core do what it does best.
Stop suffocating your architecture with outdated patterns.
Instead, focus on clear, use-case-driven services that coordinate your business logic, and let DbContext shine for data access.
Yes, sometimes the Repository Pattern still makes sense:
But for most CRUD apps? Direct EF Core is simpler, clearer, and just as testable (with the right patterns).
Pros of Skipping the Repository Pattern:
Cons (and When to Consider a Repository):
What’s your experience?
Share your thoughts in the comments below, or link to your own posts! Let’s push .NET architecture forward—together.