public ActionResult RemoveEngineer(int id) { MachineEngineer me = _db.MachineEngineers.FirstOrDefault(x => x.MachineEngineerId == id); int machineid = me.MachineId; _db.MachineEngineers.Remove(me); _db.SaveChanges(); return(RedirectToAction("Details", new { id = machineid })); }
public ActionResult Remove(int id) { MachineEngineer me = _db.MachineEngineers.Include(x => x.Machine).Include(x => x.Engineer).FirstOrDefault(x => x.MachineEngineerId == id); return(View(me)); }