public List <TaskList> GetAllLists() { List <TaskList> taskLists = taskListService.GetAll().ToList(); foreach (var list in taskLists) { List <TaskItem> tasks = taskService.GetByListId(list.Id).ToList(); list.Tasks = tasks; } return(taskLists); }