public void Updateemployee(employeeView model)
{
using (var emprep = new employeeRepository())
{
var employee= new employee();
if (emp != null)
{
emp.employee_Name = model.employee_Name;
emp.employee_Address = model.employee_Address;
emp.Email = model.Email;
emp.Contact_No = model.Contact_No;
emp.Update(emp);
}
}
}
答案 0 :(得分:0)
你忘记了id。
public void Updateemployee(employeeView model)
{
using (var emprep = new employeeRepository())
{
var employee= new employee();
if (emp != null)
{
//here
`enter code here`emp=emprep.GetById(model.emp_Id);
emp.employee_Name = model.employee_Name;
emp.employee_Address = model.employee_Address;
emp.Email = model.Email;
emp.Contact_No = model.Contact_No;
emp.Update(emp);
}
}
}