public ActionResult Create(Product product) { using (var proxy = new ProductServiceClient()) { proxy.Add(product); return(RedirectToAction("Index")); } }
public ActionResult Create(ProductServiceReference.Product pro) { ViewBag.CategoryId = new SelectList(cate.Get(), "Id", "Name"); try { // TODO: Add insert logic here if (ModelState.IsValid) { prod.Add(pro); return(RedirectToAction("Index")); } return(View()); } catch { return(View()); } }