コード例 #1
0
        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
            });
        }
コード例 #2
0
 private void WhenPerformValidation()
 {
     try
     {
         _subject.ValidateRequest(_requestPayload);
     }
     catch (ValidationException exception)
     {
         _actualException = exception;
     }
 }