public ActionResult Index() { StockServiceClient service = new StockServiceClient(); // Product[] products = service.GetAllProducts(); List<Product> products = service.GetAllProducts(); return View(products); }
public ActionResult Index() { try { StockServiceClient service = new StockServiceClient(); Product[] products = service.GetAllProducts(); return View(products); } catch (Exception ex) { return null; } }
// GET: Home public ActionResult Index() { StockServiceClient service = new StockServiceClient(); return View(service.GetAllProducts()); }