public IActionResult Put([FromBody] ProductCreateInputModel model) { try { ProductControllerHelperMethods.ValidModel(model, false); _IProductService.EditProduct(model); } catch (Exception e) { return(SendRightStatus(e)); } return(Ok()); }
public ActionResult <Guid> Post([FromBody] ProductCreateInputModel model) { Guid idOfCreatedObject = new Guid(); try { ProductControllerHelperMethods.ValidModel(model, true); idOfCreatedObject = _IProductService.SetProduct(model); } catch (Exception e) { return(SendRightStatus(e)); } return(StatusCode(StatusCodes.Status201Created, idOfCreatedObject)); }