Пример #1
0
        public IActionResult Index(int id)
        {
            TodoService todoService = new TodoService();
            var         result      = todoService.GetAllTodoItem().Find(m => m.id == id);

            return(Ok(result));
        }
Пример #2
0
        public IActionResult Index()
        {
            TodoService todoService = new TodoService();
            var         result      = todoService.GetAllTodoItem();

            return(Ok(result));
        }
Пример #3
0
        public IActionResult Delete(int id)
        {
            TodoService todoService     = new TodoService();
            var         setItemToRemove = todoService.GetTodoItem(id);
            var         result          = todoService.GetAllTodoItem();

            result.RemoveAll(m => m.id == setItemToRemove.id);
            return(Ok(result));
        }