public ActionResult <IEnumerable <Review> > GetReviewByPlace(int id) { IEnumerable <Review> reviews = ReviewDAO.GetReviewByPlace(id); return(reviews != null ? (ActionResult <IEnumerable <Review> >)Ok(reviews) : NotFound("This lieu does not exists !")); }
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); }