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(); } }
public void save(FinancialTransaction ft) { FinancialTransactions.Add(ft); SaveChanges(); }