예제 #1
0
        public async Task <IHttpActionResult> Details(int?id)
        {
            if (id.HasValue == false)
            {
                return(NotFound());
            }

            Product product = await _store.GetByIdAsync(id.Value);

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

            return(Ok(product));
        }
        // GET: Products/Details/5
        public async Task <IActionResult> Details(int?id)
        {
            if (id.HasValue == false)
            {
                return(NotFound());
            }

            Product product = await _store.GetByIdAsync(id.Value);

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

            return(View(new EditProductViewModel
            {
                Product = product,
                Discount = 5
            }));
        }