public async Task <Account> PutBalance(MoveBalance moveBalance) { var entity = await this._asyncRepository.GetByIdAsync(moveBalance.EntityDestinationId); entity.PutBalance(moveBalance.Balance); return(await this._asyncRepository.UpdateAsync(entity)); }
public async Task <Account> TakeBalance(MoveBalance moveBalance) { var accountSource = await this._asyncRepository.GetByIdAsync(moveBalance.EntitySourceId); var accountDestination = await this._asyncRepository.GetByIdAsync(moveBalance.EntityDestinationId); if (CheckBalance(accountSource, moveBalance.Balance)) { return(await this.UpdatateAccounst(accountSource, accountDestination, moveBalance.Balance)); } else { return(null); } }
public async Task <Account> PutBalance([FromBody] MoveBalance moveBalance) { return(await this._AccountService.PutBalance(moveBalance)); }