public async Task <ActionResult <CashMachineViewModel> > UpdateCashMachineStatus(Guid idCashMachine, CashMachineViewModel cashMachineViewModel) { var getStatus = await getCashMachine(idCashMachine); if (getStatus != null) { if (idCashMachine != getStatus.Id) { return(BadRequest("Os caixas informados não são iguais!")); } } if (getStatus != null) { getStatus.Status = cashMachineViewModel.Status; } try { await _cashMachineRepository.Update(_mapper.Map <CashMachine>(getStatus)); } catch (DbUpdateConcurrencyException) { throw; } return(NoContent()); }
public async Task Update(CashMachine cashMachine) { await _cashMachineRepository.Update(cashMachine); }