示例#1
0
        public async Task <ActionResult <Todo> > Delete(string id)
        {
            if (id == null || id == "")
            {
                return(BadRequest(new { message = "id is empty or null" }));
            }

            Todo todo = await todosService.GetTodoAsync(id);

            if (todo == null)
            {
                return(NotFound());
            }

            todosService.Delete(todo);

            return(Ok(new { message = "success" }));
        }