protected override async Task OnParametersSetAsync() { ListId ??= (await TodoListService.GetAllLists()).FirstOrDefault()?.Id; if (ListId == null) { var todoList = new Models.TodoList { Name = "First Todo List" }; await TodoListService.Add(todoList); ListId = todoList.Id; } TodoItems = new ObservableCollection <TodoItem>(await TodoItemService.GetList(ListId)); }