public BaseRepository() { this.context = new AMSEntities(); this.dbSet = context.Set <TEntity>(); }
public GenericRepository(AMSEntities db) { this.db = db; table = db.Set <T>(); }
public IQueryable <T> All <T>(string[] includes = null) where T : class { //HANDLE INCLUDES FOR ASSOCIATED OBJECTS IF APPLICABLE if (includes != null && includes.Count() > 0) { var query = dbContext.Set <T>().Include(includes.First()); foreach (var include in includes.Skip(1)) { query = query.Include(include); } return(query.AsQueryable()); } return(dbContext.Set <T>().AsQueryable()); }
public GenericRepository() { this.db = new AMSEntities(); table = db.Set <T>(); }