-
-
Save dcomartin/258fe0cec46ccb2787b2828632dba132 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 IAsyncRepository<T> where T : BaseEntity, IAggregateRoot | |
{ | |
Task<T> GetByIdAsync(int id, CancellationToken cancellationToken = default); | |
Task<IReadOnlyList<T>> ListAllAsync(CancellationToken cancellationToken = default); | |
Task<IReadOnlyList<T>> ListAsync(ISpecification<T> spec, CancellationToken cancellationToken = default); | |
Task<T> AddAsync(T entity, CancellationToken cancellationToken = default); | |
Task UpdateAsync(T entity, CancellationToken cancellationToken = default); | |
Task DeleteAsync(T entity, CancellationToken cancellationToken = default); | |
Task<int> CountAsync(ISpecification<T> spec, CancellationToken cancellationToken = default); | |
Task<T> FirstAsync(ISpecification<T> spec, CancellationToken cancellationToken = default); | |
Task<T> FirstOrDefaultAsync(ISpecification<T> spec, CancellationToken cancellationToken = default); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment