コード例 #1
0
        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));
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 // PUT: api/Wallet/5
 public HttpResponseMessage Put(Guid id, [FromBody] UpdateWalletCommand value)
 {
     value.Id = id;
     return(CreateResponse(_commandHandler.Handle(value)));
 }