Repository Pattern in .NET Entity Framework
Why shouldn’t I use the repository pattern with Entity Framework?
This article against Repository
Summary:
- It’s redundant to create Repositories on top of
DbContext
DbContext
is the Unit Of WorkDbSet
is the repository
- Repository provide too primitive operations and need to repeat for every model
- For abstraction, create Services on top of Entity Framework
- Service is abstraction layer, just like Repository, but with more flexible functionality
Extras: Truly generic repository