コード例 #1
0
        public async Task <IActionResult> Details(Guid id)
        {
            var product = await _productService.GetAsync(id);

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

            var fileList = await _fileService.BrowseByProductAsync(product.UserId, product.Id);

            var viewModel = new ProductViewModel
            {
                Id          = product.Id,
                Name        = product.Name,
                Category    = product.Category,
                Price       = product.Price,
                Files       = fileList.ToList(),
                Description = product.Description
            };

            return(View(viewModel));
        }