public void Save(EmployeeViewModel employeeViewModel)
{
var employee = (from emp in dataContext.Employees
where emp.EmployeeID == employeeViewModel.EmployeeID
select emp).SingleOrDefault();
if (employee != null)
{
employee.Address = employeeViewModel.Address;
employee.Salary = employeeViewModel.Salary;
employee.Title = employeeViewModel.Title;
}
dataContext.SubmitChanges();
}
public void Save(EmployeeViewModel employeeViewModel)
{
var employee = (from emp in dataContext.Employees
where emp.EmployeeID == employeeViewModel.EmployeeID
select emp).SingleOrDefault();
if (employee != null)
{
ModelCopier.CopyModel(employeeViewModel, employee);
}
dataContext.SubmitChanges();
}
Hiç yorum yok:
Yorum Gönder