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:
@@ -21,7 +21,7 @@ namespace Microsoft.eShopWeb.Web.Features.MyOrders
|
||||
public async Task<IEnumerable<OrderViewModel>> Handle(GetMyOrders request, CancellationToken cancellationToken)
|
||||
{
|
||||
var specification = new CustomerOrdersWithItemsSpecification(request.UserName);
|
||||
var orders = await _orderRepository.ListAsync(specification);
|
||||
var orders = await _orderRepository.ListAsync(specification, cancellationToken);
|
||||
|
||||
return orders.Select(o => new OrderViewModel
|
||||
{
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace Microsoft.eShopWeb.Web.Features.OrderDetails
|
||||
|
||||
public async Task<OrderViewModel> Handle(GetOrderDetails request, CancellationToken cancellationToken)
|
||||
{
|
||||
var customerOrders = await _orderRepository.ListAsync(new CustomerOrdersWithItemsSpecification(request.UserName));
|
||||
var customerOrders = await _orderRepository.ListAsync(new CustomerOrdersWithItemsSpecification(request.UserName), cancellationToken);
|
||||
var order = customerOrders.FirstOrDefault(o => o.Id == request.OrderId);
|
||||
|
||||
if (order == null)
|
||||
|
||||
Reference in New Issue
Block a user