public IActionResult Create(ApplicationType app) { if (ModelState.IsValid) { _db.Add(app); _db.SaveChanges(); return(RedirectToAction("Index")); } return(View(app)); }
public IActionResult Create(Category cat) { _db.Add(cat); _db.SaveChanges(); return(RedirectToAction("Index")); //Using ServerSide Validation //if (ModelState.IsValid) //{ // _db.Add(cat); // _db.SaveChanges(); // return RedirectToAction("Index"); //} //return View(cat); }