public async Task <IActionResult> UpdateWallet(int walletId, bool IsPaused, bool IsReleased, bool IsChurned, [FromBody] UpdateWalletRequest request) { var updateWalletCommand = new UpdateWalletCommand(walletId, request, IsPaused, IsReleased, IsChurned); var result = await mediator.Send(updateWalletCommand); return(StatusCode((int)result.Code, result.Value)); }
public ResultCommand Handle(UpdateWalletCommand command) { var result = new ResultCommand(); var wallet = _repository.GetById(command.Id); wallet.Update(); result.AddNotifications(wallet); if (result.Valid) { _repository.Update(wallet); } return(result); }
// PUT: api/Wallet/5 public HttpResponseMessage Put(Guid id, [FromBody] UpdateWalletCommand value) { value.Id = id; return(CreateResponse(_commandHandler.Handle(value))); }