public HttpResponseMessage DeleteFeedback(long FeedbackId)
 {
     try
     {
         HttpResponseMessage httpResponse = new HttpResponseMessage();
         var objRes = feedbackRepository.DeleteFeedback(FeedbackId);
         if (objRes != null && objRes.isSuccess)
         {
             httpResponse = Request.CreateResponse(HttpStatusCode.OK, objRes);
         }
         else
         {
             httpResponse = Request.CreateResponse(HttpStatusCode.Unauthorized, objRes);
         }
         return(httpResponse);
     }
     catch (Exception ex)
     {
         throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.InternalServerError)
         {
             Content      = new StringContent("An error occurred, please try again or contact the administrator."),
             ReasonPhrase = "An error occurred, please try again or contact the administrator.",
             StatusCode   = HttpStatusCode.InternalServerError
         });
     }
 }
Ejemplo n.º 2
0
 public async Task <Feedback> DeleteFeedback(int feedbackID)
 {
     return(await ifeedback.DeleteFeedback(feedbackID));
 }