-
-
Save dcomartin/d756490a5688904911d5f2f692f789a5 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<T> | |
{ | |
Task<T?> GetById<TId>(TId id, CancellationToken cancellationToken = default) where TId : notnull; | |
Task<T?> GetBySpec(ISpecification<T> specification, CancellationToken cancellationToken = default); | |
Task<List<T>> List(CancellationToken cancellationToken = default); | |
Task<List<T>> List(ISpecification<T> specification, CancellationToken cancellationToken = default); | |
Task<T> Add(T entity, CancellationToken cancellationToken = default); | |
Task<IEnumerable<T>> AddRange(IEnumerable<T> entities, CancellationToken cancellationToken = default); | |
Task Update(T entity, CancellationToken cancellationToken = default); | |
Task DeleteAsync(T entity, CancellationToken cancellationToken = default); | |
Task<int> SaveChangesAsync(CancellationToken cancellationToken = default); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment