public Task Handle(DeleteBasketRequest request) { var domainBasket = _store.GetById(request.Id); if (domainBasket == null) { return(Task.CompletedTask); } _store.Delete(request.Id); return(Task.CompletedTask); }
public async Task <DeleteBasketResponse> Clear(Guid sessionId) { var policy = _pollyPolicyProvider.BasketStorePolicy(); var result = await policy.ExecuteAndCaptureAsync(async() => { await _basketStore.Delete(sessionId); }); if (result.Outcome == OutcomeType.Failure) { //LOG var response = new DeleteBasketResponse(); response.AddError(result.FinalException.Message); return(response); } return(new DeleteBasketResponse()); }