//For Details Page Only - loop through each product and get their primary image private void PrimaryProductImage(ProductViewModel _productList) { _productList.productList.ForEach(item => _productList.PrimaryProduct_Image = _productDataSerice.GetImages(item.Product_Id).FirstOrDefault() ); }