public async Task <IEnumerable <TEntity> > GetAll(string[] includetbl = null) { IQueryable <TEntity> query = _context.Set <TEntity>(); if (includetbl != null) { foreach (var item in includetbl) { query = query.Include(item); } } return(await query.ToListAsync()); }
public List <TEntity> GetAll() { return(_context.Set <TEntity>().ToList()); }