public ActionResult <ConsumedProductResponse> PostConsumedProduct(ConsumedProductRequest consumedProductReqest) { var consumedProduct = _mapper.Map <ConsumedProduct>(consumedProductReqest); _consumedProductService.Create(consumedProduct); return(CreatedAtAction("GetConsumedProduct", new { id = consumedProduct.Id }, consumedProduct)); }
public IActionResult PutConsumedProduct(Guid id, ConsumedProductRequest consumedProductRequest) { if (id != consumedProductRequest.Id) { return(BadRequest()); } var consumedProduct = _mapper.Map <ConsumedProduct>(consumedProductRequest); _consumedProductService.Update(consumedProduct); return(NoContent()); }