Skip to content

Instantly share code, notes, and snippets.

@FraukeN
Created February 14, 2018 20:01
Show Gist options
  • Save FraukeN/fea19b6e6193138ea71a767e61fb46de to your computer and use it in GitHub Desktop.
Save FraukeN/fea19b6e6193138ea71a767e61fb46de to your computer and use it in GitHub Desktop.
IRepository
public interface IRepository<T>
where T : class, IEntity, new()
{
Task<T> GetAsync(int Id);
Task<IEnumerable<T>> GetAsync();
Task<IEnumerable<T>> GetAsync(Expression<Func<T, bool>> predicate);
Task<IEnumerable<T>> GetAsync(int skip, int take);
Task<IEnumerable<T>> GetAsync(Expression<Func<T, bool>> predicate, int skip, int take);
Task<T> FindAsync(Expression<Func<T, bool>> predicate);
Task<int> AddAsync(T entity);
Task AddRangeAsync(IEnumerable<T> entities);
Task<bool> UpdateAsync(T entity);
Task DeleteAsync(T entity);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment