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 }))); }
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)); }