DEV Community

Avoiding the Repository Pattern with an ORM

Derek Comartin - CodeOpinion on October 09, 2019

For many years now I’ve advocated not using the repository pattern on top of an ORM such as Entity Framework. There are many reasons why that I’l...
Collapse
 
azeem2793 profile image
Agha Azeem

Great Article.
just a little confusion. If we do not use repository pattern then our DB queries will still reside in DALclasses(StudentDAL.cs which has createstudent(), update student(std),getstudent()....) right? so is not it good to use repository pattern instead of DAL classes to encapsulate our quries or SP calls.
just asking :)

Collapse
 
smartcodinghub profile image
Oscar

I've been working this way for a while. As in the original post, a highly specialized Repository is practically the same as a Query Object. But working this and CQRS speeds up the development.