public ActionResult Delete(int id) { Employee employee = db.Employees.Find(id); db.Employees.Remove(employee); db.SaveChanges(); return(Json(employee, JsonRequestBehavior.AllowGet)); }
public ActionResult Create([Bind(Include = "Did,DName,HOD,Gender")] Department department) { if (ModelState.IsValid) { db.Departments.Add(department); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(department)); }