public void AddExpenseToGroup(Expense expense, int groupId) { Group group = GetGroup(groupId); int expenseCount = group.ExpenseCount; expense.Id = expenseCount + 1; group.AddExpense(expense); }
public void Execute() { IRepository repo = new InMemoryRepository(); Validate(repo); Expense expense = new Expense(description, amount, owner); repo.AddExpenseToGroup(expense, groupId); }
public void AddExpense(Expense expense) { expenses.Add(expense); }