public string ApiDeleteCommentById(int id) { CommentDAO commentDAO = new CommentDAO(); if (commentDAO.DeleteCommentById(id, out string message)) { return("Comentario excluido com sucesso! "); } else { return("Erro ao deletar o comentario " + message); } }
public HttpResponseMessage ApiDeleteCommentById(int id) { CommentDAO commentDAO = new CommentDAO(); if (commentDAO.DeleteCommentById(id, out string message)) { return(new HttpResponseMessage(HttpStatusCode.NoContent)); } else { HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.InternalServerError, message); return(response); } }