Ejemplo n.º 1
0
        public async Task <ActionResult <TodoItem> > DeleteTodoItem(long id)
        {
            var todoItem = await _context.FindAsync <TodoItem>(id);

            if (todoItem == null)
            {
                return(NotFound());
            }
            _context.TodoItems.Remove(todoItem);
            await _context.SaveChangesAsync();

            return(todoItem);
        }