无法删除尚未附加的实体。
Employee deleteEmp = HrDB.Employee.SingleOrDefault(e => e.EmpID == id); HrDB.Employee.Attach(deleteEmp);
HrDB.Employee.DeleteOnSubmit(deleteEmp);