Example #1
0
        // GET: ProductViews/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ProductView productView = new ProductView(serviceProducts.GetProduct(Convert.ToInt32(id)));

            if (productView == null)
            {
                return(HttpNotFound());
            }
            return(View(productView));
        }
        // GET: Products/Details/5
        public async Task <IActionResult> Details(int?productId)
        {
            if (productId == null)
            {
                return(NotFound());
            }

            var _result = await _serviceProducts.GetProduct(productId.Value);

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

            return(View(_result));
        }