public ActionResult CreateOrUpdate(ProductModel productModel) { if (ModelState.IsValid && productModel.IsValid()) { this.productModelTasks.CreateOrUpdate(productModel); return this.RedirectToAction(x => x.Index()); } return View(productModel); }
public ProductModel CreateOrUpdate(ProductModel productModel) { productModel.ModifiedDate = DateTime.Now; this.productModelRepository.SaveOrUpdate(productModel); return productModel; }