public ActionResult GetProduct(string id) { //this is for AJAX calls var product = new Product(new Guid(id));// _productRepository.GetProduct(id); if (product != null) { JsonProduct jsonProduct = new JsonProduct(); jsonProduct.SKU = product.SKU; jsonProduct.Photo = product.DefaultImageFile; jsonProduct.ProductName = product.ProductName; jsonProduct.Price = product.BasePrice.ToString("C"); return(Json(jsonProduct)); } else { return(new EmptyResult()); } }
public ActionResult GetProduct(string id) { //this is for AJAX calls var product = new Product(new Guid(id));// _productRepository.GetProduct(id); if (product != null) { JsonProduct jsonProduct = new JsonProduct(); jsonProduct.SKU = product.SKU; jsonProduct.Photo = product.DefaultImageFile; jsonProduct.ProductName = product.ProductName; jsonProduct.Price = product.BasePrice.ToString("C"); return Json(jsonProduct); } else { return new EmptyResult(); } }