public ActionResult Create(CreateProductModel model) { try { if (ModelState.IsValid) { var entity = model.ToEntity(); _productService.Add(entity); } return RedirectToAction("Index"); } catch { return View(); } }
// // GET: /Admin/Product/Create public ActionResult Create() { var model = new CreateProductModel(); model.AllCategories = _productCategoryService.GetProductCategorySelectList(model.CategoryName, GlobalHelper.SelectListDefaultOption); return View(model); }