add CancellationToken to GetAllAsync

This commit is contained in:
tekh 2025-09-12 11:45:12 +02:00
parent 63c97b4dc7
commit 56b467ddfc
2 changed files with 3 additions and 3 deletions

View File

@ -23,8 +23,8 @@ public static class Extensions
public static IEnumerable<TEntity> GetAll<TEntity>(this IRepository repository) where TEntity : IEntity
=> repository.Entity<TEntity>().GetAll();
public static Task<IEnumerable<TEntity>> GetAllAsync<TEntity>(this IRepository repository) where TEntity : IEntity
=> repository.Entity<TEntity>().GetAllAsync();
public static Task<IEnumerable<TEntity>> GetAllAsync<TEntity>(this IRepository repository, CancellationToken cancel = default) where TEntity : IEntity
=> repository.Entity<TEntity>().GetAllAsync(cancel);
public static IQueryable<TEntity> Where<TEntity>(this IRepository repository, Expression<Func<TEntity, bool>> expression)
where TEntity : IEntity

View File

@ -15,7 +15,7 @@ public interface IRepository<TEntity>
public IEnumerable<TEntity> GetAll();
public Task<IEnumerable<TEntity>> GetAllAsync();
public Task<IEnumerable<TEntity>> GetAllAsync(CancellationToken cancel = default);
public Task UpdateAsync<TDto>(TDto dto, Expression<Func<TEntity, bool>> expression, CancellationToken cancel = default);