public void InsertEmployeeWithCT(EmployeeWithCT employeeWithCT) { if ((employeeWithCT.EntityState != EntityState.Detached)) { this.ObjectContext.ObjectStateManager.ChangeObjectState(employeeWithCT, EntityState.Added); } else { this.ObjectContext.EmployeeWithCTs.AddObject(employeeWithCT); } }
public void DeleteEmployeeWithCT(EmployeeWithCT employeeWithCT) { if ((employeeWithCT.EntityState != EntityState.Detached)) { this.ObjectContext.ObjectStateManager.ChangeObjectState(employeeWithCT, EntityState.Deleted); } else { this.ObjectContext.EmployeeWithCTs.Attach(employeeWithCT); this.ObjectContext.EmployeeWithCTs.DeleteObject(employeeWithCT); } }
public void UpdateEmployeeWithCT(EmployeeWithCT currentEmployeeWithCT) { this.ObjectContext.EmployeeWithCTs.AttachAsModified(currentEmployeeWithCT, this.ChangeSet.GetOriginal(currentEmployeeWithCT)); }