forked from dotnet-architecture/eShopOnWeb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use cancellation token in repository and web fie system (http call ca…
…n cancelled) (dotnet-architecture#471) Co-authored-by: cmichel <cmichel@interparking.com>
- Loading branch information
1 parent
2502e01
commit 6041a1f
Showing
19 changed files
with
95 additions
and
97 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
} |
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.