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)); }
public async Task NewTodoList(Models.TodoList todoList) { await TodoListService.Add(todoList); }
public IActionResult Add([FromBody] string item) { _todoListService.Add(item); return(Ok()); }