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); }
public ActionResult <ReviewAndUser> GetReviewAndUser(int id) { ReviewAndUser reviewAndUser = _reviewService.GetReviewAndUser(id); return(reviewAndUser != null ? (ActionResult <ReviewAndUser>)Ok(reviewAndUser) : NotFound("Review not found")); }