public IActionResult Update([FromRoute] int id, [FromBody] VendingMachineProductPrice request) { var actionResult = new CustomActionResult { Successful = true, Message = "Product price was successfull updated for Vending Machine!" }; try { request.SetAudit(CurrentLoggedUserId); var vendingMachineProductPrice = _vendingMachineProductPriceService.Update(request); actionResult.EntityId = vendingMachineProductPrice.Id; } catch { actionResult.Successful = false; actionResult.Message = "Product price was unsuccessfull updated for Vending Machine, please try again!!"; return(Ok(actionResult)); } return(Ok(actionResult)); }
public VendingMachineProductPrice Update(VendingMachineProductPrice request) { var vendingMachineProductPrice = _repository.Update(request); _repository.Save(); return(vendingMachineProductPrice); }