/// <summary> /// Transfers the specified account. /// </summary> /// <param name="account">The account.</param> /// <param name="transfer">The transfer.</param> /// <param name="count">The count.</param> public void Transfer(AccountBll account, AccountBll transfer, decimal count) { Check(account); Check(transfer); account.Withdraw(count); transfer.Deposit(count); accountRepository.Update(account.ToDalAccount()); accountRepository.Update(transfer.ToDalAccount()); context.Save(); }
/// <summary> /// Deposit the specified count. /// </summary> /// <param name="count">The count.</param> /// <param name="account">The account.</param> /// <exception cref="ArgumentException">count</exception> public void Deposit(decimal count, AccountBll account) { Check(account); if (count < 0) { throw new ArgumentException($"{nameof(count)} is less 0"); } account.Deposit(count); accountRepository.Update(account.ToDalAccount()); context.Save(); }