public void Rechrage(decimal amount, Guid requestId) { CheckRule(new UserBalanceNonnegativeRule(amount)); var transcation = UserTranscation.Create(null, this, requestId, amount); _Transfer(transcation); }
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)); }