public ActionResult Create(Certification certification) { if (ModelState.IsValid) { db.Certifications.Add(certification); db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.InstitutionId = new SelectList(db.Institutions, "Id", "Name", certification.InstitutionId); return View(certification); }
public ActionResult Edit(Certification certification) { if (ModelState.IsValid) { db.Entry(certification).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.InstitutionId = new SelectList(db.Institutions, "Id", "Name", certification.InstitutionId); return View(certification); }