コード例 #1
0
 public JsonResult DeleteRestaurantReview(int parameter)
 {
     try
     {
         _restaurantReviewTask.RemoveRestaurantReview(parameter);
         return(Json(new { status = ActionStatus.Successful }));
     }
     catch (Exception exception)
     {
         return(Json(new { status = ActionStatus.Failed, data = exception.Message }));
     }
 }
コード例 #2
0
        public HttpResponseMessage DeleteRestaurantReview(int restaurantReviewId)
        {
            var response = new HttpResponseMessage();

            try
            {
                _restaurantReviewTask.RemoveRestaurantReview(restaurantReviewId);
                response.StatusCode = HttpStatusCode.OK;
            }
            catch
            {
                response.StatusCode = HttpStatusCode.ExpectationFailed;
            }

            return(response);
        }