Example #1
0
 public BudgetCategory AddTransaction(FinancialTransaction transaction)
 {
     if (!IsClosed) {
         FinancialTransactions newTransactions = new FinancialTransactions();
         newTransactions.AddRange(this.transactions);
         newTransactions.Add(transaction);
         return new BudgetCategory(this.Name, this.Budget, this.IsClosed, newTransactions);
     } else {
         throw new BudgetIsClosedException();
     }
 }