[HttpGet] public ActionResult EmployeeView(int id) { Employee employee = new Employee(); using (HRMSEntities employeeContext = new HRMSEntities()) { employee = employeeContext.Employee.Where(x => x.Person_Id == id).FirstOrDefault(); } return View(employee); } }
Try id.ToString(), if that doesn't work :
id.ToString()
string idAsString = id.ToString();
and then x => x.Person_Id == idAsString
x => x.Person_Id == idAsString
1.4m articles
1.4m replys
5 comments
57.0k users