Example #1
0
        public void Rechrage(decimal amount, Guid requestId)
        {
            CheckRule(new UserBalanceNonnegativeRule(amount));

            var transcation = UserTranscation.Create(null, this, requestId, amount);

            _Transfer(transcation);
        }
Example #2
0
        public void TransferTo(User recevier, decimal amount, Guid requestId)
        {
            CheckRule(new UserBalanceNonnegativeRule(amount));

            var transcation = UserTranscation.Create(this, recevier, requestId, amount);

            recevier._Transfer(transcation);
            this._Transfer(UserTranscation.CreateReverse(transcation));

            AddDomainEvent(new UserTransferSuccessEvent(this, recevier, amount));
        }