示例#1
0
        public async Task <ActionResult <ToDoItem> > Delete(Guid id)
        {
            var deletedItem = await _todoContext.Delete(id);

            if (deletedItem == null)
            {
                return(BadRequest());
            }
            return(Ok(deletedItem));
        }
示例#2
0
        public bool Delete(int TodoId, out string Error)
        {
            Error = string.Empty;

            TaskRepository _taskRepository = new TaskRepository();
            bool           status          = _taskRepository.DeleteByTodo(TodoId, out Error);

            if (status)
            {
                status = _todoContext.Delete(TodoId, out Error);
            }

            return(status);
        }