public async Task <ActionResult> DeleteConfirmed(int id) { LecturerSet lecturerSet = await db.LecturerSet.FindAsync(id); db.LecturerSet.Remove(lecturerSet); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit(LecturerSet lecturerSet) { if (ModelState.IsValid) { db.Entry(lecturerSet).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(lecturerSet)); }
public async Task <ActionResult> Create(LecturerSet lecturerSet) { if (ModelState.IsValid) { db.LecturerSet.Add(lecturerSet); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(lecturerSet)); }
public async Task <ActionResult> Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } LecturerSet lecturerSet = await db.LecturerSet.FindAsync(id); if (lecturerSet == null) { return(HttpNotFound()); } return(View(lecturerSet)); }