public List <ToDoItem> OrderItems(OrderBySelection orderBySelection) { List <ToDoItem> orderedItems = new List <ToDoItem>(); ToDoItemRepository toDoItemRepository = new ToDoItemRepository(); switch (orderBySelection) { case OrderBySelection.CreateDate: orderedItems = toDoItemRepository.OrderByCreateDate(selectedList.listId); break; case OrderBySelection.Deadline: orderedItems = toDoItemRepository.OrderByDeadline(selectedList.listId); break; case OrderBySelection.Name: orderedItems = toDoItemRepository.OrderByName(selectedList.listId); break; case OrderBySelection.Status: orderedItems = toDoItemRepository.OrderByStatus(selectedList.listId); break; default: break; } return(orderedItems); }