示例#1
0
        public ActionResult <ProductReview> GetReviewById(int id)
        {
            ProductReview review = dao.Get(id);

            if (review == null)
            {
                return(NotFound());
            }
            return(Ok(review));
        }
示例#2
0
        public ActionResult <Item> GetItemById(int id)
        {
            Item item = dao.Get(id);

            if (item == null)
            {
                return(NotFound());
            }

            return(Ok(item));
        }
示例#3
0
        public ActionResult <ProductReview> GetReviewById(int id)
        {
            // See if the review exist
            ProductReview review = dao.Get(id);

            // If it does not, return 404
            if (review == null)
            {
                return(NotFound());
            }

            // If it does, return 200
            return(Ok(review));
        }