Example #1
0
        public IActionResult Get(int id)
        {
            var offer = _offerDatabase.GetById(id);

            if (offer == null)
            {
                return(NotFound());
            }
            return(Ok(offer));
        }
Example #2
0
        public IActionResult Get(int id)
        {
            var product = _productDatabase.GetById(id);

            if (product == null)
            {
                return(NotFound());
            }
            if (product.OfferId > 0)
            {
                var offer = _offerDatabase.GetById(product.OfferId);
                product.Offer = offer;
            }
            return(Ok(product));
        }