public async Task <Case> DeleteOne(string id) { var expenses = await expenseRepo.GetByCaseId(id); var success = await expenseRepo.DeleteRange(expenses); if (success) { return(await DeleteAsync(id)); } return(null); }
public Task <IEnumerable <Expense> > GetExpenses(string caseId) { return(expenseRepo.GetByCaseId(caseId)); }
public async Task <IEnumerable <Expense> > GetByCaseId(string caseId) { var list = await repo.GetByCaseId(caseId); return(list.OrderByDescending(x => x.CreatedAt)); }