public async Task <IActionResult> PutAsync(string id, UpdateDepositDto depositDto) { var deposit = await _depositRepository.GetByIDAsync(id); if (deposit == null) { return(NotFound()); } deposit.LastAmount = depositDto.LastAmount; deposit.Balance = depositDto.Balance; await _depositRepository.UpdateAsync(deposit); await _publishEndpoint.Publish(new DepositUpdated( deposit.CustomerCID, deposit.LastAmount, deposit.Balance )); return(NoContent()); }