public ActionResult Create(Recruiter collection) { try { db.Recruiter.Add(collection); db.SaveChanges(); // TODO: Add insert logic here return RedirectToAction("Index"); } catch { return View(); } }
public ActionResult Edit(int id, Recruiter collection) { try { // TODO: Add update logic here Recruiter obj = db.Recruiter.FirstOrDefault(x => x.RecruiterId == id); obj.Name = collection.Name; obj.Email = collection.Email; db.SaveChanges(); return RedirectToAction("Index"); } catch { return View(); } }