Use cancellation token in repository and web fie system (http call can cancelled) (#471)
Co-authored-by: cmichel <cmichel@interparking.com>
This commit is contained in:
@@ -1,20 +1,21 @@
|
||||
using Ardalis.Specification;
|
||||
using Microsoft.eShopWeb.ApplicationCore.Entities;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Microsoft.eShopWeb.ApplicationCore.Interfaces
|
||||
{
|
||||
public interface IAsyncRepository<T> where T : BaseEntity, IAggregateRoot
|
||||
{
|
||||
Task<T> GetByIdAsync(int id);
|
||||
Task<IReadOnlyList<T>> ListAllAsync();
|
||||
Task<IReadOnlyList<T>> ListAsync(ISpecification<T> spec);
|
||||
Task<T> AddAsync(T entity);
|
||||
Task UpdateAsync(T entity);
|
||||
Task DeleteAsync(T entity);
|
||||
Task<int> CountAsync(ISpecification<T> spec);
|
||||
Task<T> FirstAsync(ISpecification<T> spec);
|
||||
Task<T> FirstOrDefaultAsync(ISpecification<T> spec);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
using System.Threading.Tasks;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Microsoft.eShopWeb.ApplicationCore.Interfaces
|
||||
{
|
||||
public interface IFileSystem
|
||||
{
|
||||
Task<bool> SavePicture(string pictureName, string pictureBase64);
|
||||
Task<bool> SavePicture(string pictureName, string pictureBase64, CancellationToken cancellationToken);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user