public async Task <ProductCreatedResponse> CreateProductAsync(CreateOrUpdateProductRequest body) { _validator.ValidateRequest(body); var dbProduct = Map(body); var productId = await _repository.CreateProduct(dbProduct); return(new ProductCreatedResponse { Id = productId }); }
private void WhenPerformValidation() { try { _subject.ValidateRequest(_requestPayload); } catch (ValidationException exception) { _actualException = exception; } }