public ActionResult Create(Project project) { if (ModelState.IsValid) { db.Projects.Add(project); db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.Creator_UserId = new SelectList(db.UserProfiles, "UserId", "UserName", project.Creator_UserId); return View(project); }
public ActionResult Edit(Project project) { if (ModelState.IsValid) { db.Entry(project).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.Creator_UserId = new SelectList(db.UserProfiles, "UserId", "UserName", project.Creator_UserId); return View(project); }