public IHttpActionResult UpdateProduct(UpdateProductRequestDto productRequestDto)
        {
            Product product = _productsMapper.ToProduct(productRequestDto);

            _productService.UpdateProduct(product, productRequestDto.CategoryTypes);
            return(new StatusCodeResult(HttpStatusCode.NoContent, this));
        }
Exemple #2
0
 public Product ToProduct(UpdateProductRequestDto productRequestDto)
 {
     return(new Product
     {
         Id = productRequestDto.Id,
         Name = productRequestDto.Name,
         Price = productRequestDto.Price,
         Stock = productRequestDto.Stock
     });
 }