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,9 +1,9 @@
|
||||
using System.Threading;
|
||||
using Ardalis.ApiEndpoints;
|
||||
using Ardalis.ApiEndpoints;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.eShopWeb.ApplicationCore.Entities;
|
||||
using Microsoft.eShopWeb.ApplicationCore.Interfaces;
|
||||
using Swashbuckle.AspNetCore.Annotations;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Microsoft.eShopWeb.PublicApi.CatalogItemEndpoints
|
||||
@@ -30,7 +30,7 @@ namespace Microsoft.eShopWeb.PublicApi.CatalogItemEndpoints
|
||||
{
|
||||
var response = new GetByIdCatalogItemResponse(request.CorrelationId());
|
||||
|
||||
var item = await _itemRepository.GetByIdAsync(request.CatalogItemId);
|
||||
var item = await _itemRepository.GetByIdAsync(request.CatalogItemId, cancellationToken);
|
||||
if (item is null) return NotFound();
|
||||
|
||||
response.CatalogItem = new CatalogItemDto
|
||||
|
||||
Reference in New Issue
Block a user