public List <ProductDto> GetAll() { return(repo.GetAll().Select(x => new ProductDto { Id = x.Id, Name = x.Name, Barcode = x.Barcode, Description = x.Description, Price = x.Price, Quantity = x.Quantity, Images = imageService.ProductImages(x.Id), Cover = imageService.Cover(x.Id), }).ToList()); }
// GET: admin/product/Products/Details/5 public IActionResult Details(int id) { var product = productService.GetById(id); if (product == null) { return(NotFound()); } ProductModel model = new ProductModel { Id = product.Id, Name = product.Name, Barcode = product.Barcode, Description = product.Description, Price = product.Price, Quantity = product.Quantity, Images = productImageService.ProductImages(id) }; product.Images = productImageService.ProductImages(id); return(View(model)); }