Пример #1
0
        public async Task <long?> DepositAsync(IncreaseBalance command)
        {
            var card = await _repository.GetOrCreate(command.CardId);

            if (card.IsRemoved)
            {
                return(default);
Пример #2
0
        public async Task <IActionResult> Deposit([FromRoute] Guid cardId, DepositFormModel model)
        {
            var id    = new CardId(cardId);
            var money = new Money(model.Amount, model.Currency);

            var command = new IncreaseBalance(id, money);

            var version = await _cardService.DepositAsync(command);

            return(Ok(version));
        }