Created
August 29, 2021 21:28
-
-
Save felipebaltazar/e28ca68dfd49f2c6ccb448b18cfccfae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IRepository<TEntity> where TEntity : Base | |
{ | |
ValueTask InsertAsync(TEntity entityToInsert); | |
ValueTask<TEntity> GetAsync(Expression<Func<TEntity, bool>> predicate); | |
ValueTask<TEntity> FirstOrDefaultAsync<TField>(Expression<Func<TEntity, TField>> orderBy); | |
ValueTask<TEntity> LastOrDefaultAsync<TField>(Expression<Func<TEntity, TField>> orderBy); | |
ValueTask<IEnumerable<TEntity>> GetManyAsync(Expression<Func<TEntity, bool>> predicate, int skip = 0, int limit = int.MaxValue); | |
ValueTask UpdateAsync(TEntity entityToUpdate, Expression<Func<TEntity, bool>> predicate); | |
ValueTask<bool> Exists(TEntity entity); | |
ValueTask<bool> DeleteAsync(TEntity entityToDelete); | |
int Count(Expression<Func<TEntity, bool>> predicate); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment