示例#1
0
        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 !"));
        }
示例#2
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);
        }