Why DbContext object shouldn't be referred in Service Layer?

Posted by nazmoonnoor on Programmers See other posts from Programmers or by nazmoonnoor
Published on 2014-06-04T03:55:48Z Indexed on 2014/06/09 15:41 UTC
Read the original article Hit count: 213

Filed under:
|

I've been looking for some implementations of Service Layer and Controller interaction in blogs and in some open source projects. All of them seem to refer DbContext object in repository classes but avoided to use in service classes. Service classes essentially using a IQueryable<T> references of DbSet<T>. I want to know why this practice is good and why DbContext shouldn't have a reference in Service Layer.

© Programmers or respective owner

Related posts about c#

Related posts about entity-framework