예제 #1
0
        public ActionResult <ConsumedProductResponse> PostConsumedProduct(ConsumedProductRequest consumedProductReqest)
        {
            var consumedProduct = _mapper.Map <ConsumedProduct>(consumedProductReqest);

            _consumedProductService.Create(consumedProduct);

            return(CreatedAtAction("GetConsumedProduct", new { id = consumedProduct.Id }, consumedProduct));
        }
예제 #2
0
        public IActionResult PutConsumedProduct(Guid id, ConsumedProductRequest consumedProductRequest)
        {
            if (id != consumedProductRequest.Id)
            {
                return(BadRequest());
            }

            var consumedProduct = _mapper.Map <ConsumedProduct>(consumedProductRequest);

            _consumedProductService.Update(consumedProduct);

            return(NoContent());
        }