public void UpdateEmployee(Employee employee) { Employee e = context.Employees.Find(employee.Id); if (e != null) { context.Entry(e).State = EntityState.Modified; context.SaveChanges(); } }
public long InsertEmployee(Employee employee) { context.Employees.Add(employee); context.SaveChanges(); return employee.Id; }