Example #1
0
        public async Task <IActionResult> Details(int id)
        {
            var product = await products.FindByIdAsync(id);

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

            return(await Task.Run(() => View(new ProductDetailsViewModel
            {
                Id = product.Id,
                Title = product.Title,
                LongDescription = product.LongDescription,
                Images = product.Images
            })));
        }
Example #2
0
        public async Task <IActionResult> Details(int id)
        {
            var product = await products.FindByIdAsync(id).ConfigureAwait(false);

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

            return(await Task.Run(() => View(new ProductDetailsViewModel
            {
                Id = product.Id,
                Title = product.Title,
                Description = product.Description,
                Images = product.Images,
                ProductAttributes = product.ProductAttributes
            }))
                   .ConfigureAwait(false));
        }