public ActionResult Edit(UserDetail userdetail) { if (ModelState.IsValid) { context.Entry(userdetail).State = EntityState.Modified; context.SaveChanges(); return RedirectToAction("Index","Home"); } return View(userdetail); }
public ActionResult Create(UserDetail userdetail) { if (ModelState.IsValid) { context.UserDetails.Add(userdetail); context.SaveChanges(); return RedirectToAction("Index"); } return View(userdetail); }