public ActionResult Create(客戶分類 customerCategory) { if (ModelState.IsValid) { repo.Add(customerCategory); repo.UnitOfWork.Commit(); return(RedirectToAction("Index")); } return(View(customerCategory)); }
public ActionResult Create([Bind(Include = "Id,分類名稱")] 客戶分類 category) { if (ModelState.IsValid) { categoryRepo.Add(category); categoryRepo.UnitOfWork.Commit(); return(RedirectToAction("Index")); } return(View(category)); }