c# - Entity Framework ObjectContext lifetime in an n-tier project -
i'm building large solution client code reuseability keyword since different types of projects (i.e. websites, wcf services, wpf etc) should use exact same businesslogic. right now, solution looks this: businesslogic layer (all of logic defines business rules added here) interfaces model (viewmodels, dtos etc) repository (currently using entity framework 6. database transactions go) webservices (wcf services) mvc website the point presentation layer (i.e. mvc website) use businesslogic layer uses repository make database transaction needed. while works way want to, find myself battleing objectcontext entity framework, because, when querying data in repository, entities doesn't transferred businesslogic (which logical because of efs lazy-loading) i'm aware can make use of .include(x => x.myothertable) , since database large, approach gets bloated , queries can rather large if included table has lot of records. i've made dbcontextmanager class loo...