Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hbulens/1d44b0d09447e6f58f36a62d783cd6c7 to your computer and use it in GitHub Desktop.
Save hbulens/1d44b0d09447e6f58f36a62d783cd6c7 to your computer and use it in GitHub Desktop.
public virtual async Task<List<TEntity>> FindAllAsync(Expression<Func<TEntity, bool>> where = null, params string[] includes)
{
IQueryable<TEntity> query = where == null ? this.Context.Set<TEntity>() : this.Context.Set<TEntity>().Where(where);
foreach (var include in includes) query = query.Include(include);
return await query.ToListAsync();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment