public IActionResult Index(int id) { TodoService todoService = new TodoService(); var result = todoService.GetAllTodoItem().Find(m => m.id == id); return(Ok(result)); }
public IActionResult Index() { TodoService todoService = new TodoService(); var result = todoService.GetAllTodoItem(); return(Ok(result)); }
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)); }