public IEnumerable <T> GetAll(string[] includes = null) { //HANDLE INCLUDES FOR ASSOCIATED OBJECTS IF APPLICABLE if (includes != null && includes.Count() > 0) { var query = dataContext.Set <T>().Include(includes.First()); foreach (var include in includes.Skip(1)) { query = query.Include(include); } return(query.AsQueryable()); } return(dataContext.Set <T>().AsQueryable()); }
public UserRepository(OnlineShoppingDbContext context) { this.context = context; table = context.Set <T>(); }
public UserRepository() { this.context = new OnlineShoppingDbContext(); table = context.Set <T>(); }
public virtual IEnumerable <T> GetAll() { return(_context.Set <T>().AsEnumerable()); }