コード例 #1
0
        public IEnumerable <ReviewAndUser> GetReviewAndUserByPlace(int idPlace)
        {
            IEnumerable <Review> reviews = ReviewDAO.GetReviewByPlace(idPlace);

            ReviewAndUser[] reviewAndUsers = new ReviewAndUser[reviews.Count()];
            int             i = 0;

            foreach (var review in reviews)
            {
                reviewAndUsers[i] = GetReviewAndUser(review.Id);
                i++;
            }
            return(reviewAndUsers);
        }
コード例 #2
0
        public ActionResult <ReviewAndUser> GetReviewAndUser(int id)
        {
            ReviewAndUser reviewAndUser = _reviewService.GetReviewAndUser(id);

            return(reviewAndUser != null ? (ActionResult <ReviewAndUser>)Ok(reviewAndUser) : NotFound("Review not found"));
        }