public async Task <List <Expense> > UpdateExpensesWhen(DirectDebitAdded notification) { var expenseRecipient = await _expenseRecipientRepository.FindById(notification.ExpenseRecipientId); if (expenseRecipient == null) { return(new List <Expense>()); } var expenses = await _expenseRepository.FindByDirectDebitCode(notification.Code); foreach (var expense in expenses) { expense.SetExpenseRecipient(expenseRecipient.ExpenseRecipientId); expense.SetExpenseCategory(expenseRecipient.ExpenseCategoryId); } return(expenses); }