コード例 #1
0
        public IHttpActionResult AddReview(int userId, Review review)
        {
            ErrorMessage errorMessage = usersBL.AddReview(userId, review);

            if (errorMessage.Code == HttpStatusCode.OK)
            {
                User updatedUser = usersBL.GetUser(userId);
                return(Ok(updatedUser));
            }

            return(new ResponseMessageResult(Request.CreateErrorResponse(
                                                 errorMessage.Code,
                                                 new HttpError(errorMessage.Message)
                                                 )
                                             ));
        }