To clarify things a bit more - in EntityFramework the DbContext is a unit-of-work, and IDbSet<T> is a repository. They are abstractions and by wrapping it with your own, you're making an abstraction over an abstraction, and in my opinion you gain
nothing but complexity.
Participant
1310 Points
442 Posts
Re: Understanding The Nuances Of Repository Pattern
Mar 22, 2016 06:31 PM|deepalgorithm|LINK
To clarify things a bit more - in EntityFramework the DbContext is a unit-of-work, and IDbSet<T> is a repository. They are abstractions and by wrapping it with your own, you're making an abstraction over an abstraction, and in my opinion you gain nothing but complexity.
Please take a look at the following post:
http://rob.conery.io/2014/03/04/repositories-and-unitofwork-are-not-a-good-idea/
That being said, to answer your question - your business layer will have a reference to your EF context or a repository you build yourself.
Additionally, I recommend you use DTOs vs. returning the Entities directly.