DBContext Find with Includes - where lambda with Primary keys
I am writing a generic repository to interface with EF using DBContext. I have a generic Get() method which receives a primary key value and returns the entity: public class DALRepository<DALEntity> : IDisposable, IGenericRepository<DALEntity> where DALEntity : class { private IDbSet<DALEntity> dbSet; private NWEntities context; public DALRepository() { context = new NWEntities(); context.Configuration.LazyLoadingEnabled = false; dbSet = context.Set<DALEntity>(); } Here's a simple get method - just works on the PK - exactly what I want. public DALEntity Get(string ID) { return dbSet.Find(ID);