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

            return(Ok());
        }