public ActionResult <List <Product> > Index(int brandId) { ProductItemDAO dao = new ProductItemDAO(_db); List <Product> itemsForBrand = dao.GetAllByBrand(brandId); return(itemsForBrand); }
public ActionResult <List <Product> > Index(int brandid) { ProductItemDAO dao = new ProductItemDAO(_db); List <Product> itemsForBrand = dao.GetAllByBrand(brandid); foreach (Product product in itemsForBrand) { product.BrandId = brandid; } return(itemsForBrand); }