public void DeleteEmployeeHistoryEntry(EmployeeHistoryEntry employeeHistoryEntry) { if ((employeeHistoryEntry.EntityState != EntityState.Detached)) { this.ObjectContext.ObjectStateManager.ChangeObjectState(employeeHistoryEntry, EntityState.Deleted); } else { this.ObjectContext.EmployeeHistoryEntries.Attach(employeeHistoryEntry); this.ObjectContext.EmployeeHistoryEntries.DeleteObject(employeeHistoryEntry); } }
public void UpdateEmployeeHistoryEntry(EmployeeHistoryEntry currentEmployeeHistoryEntry) { currentEmployeeHistoryEntry.LastModified = DateTime.UtcNow; currentEmployeeHistoryEntry.LastModifyingUserId = CurrentUserAccount().Id; this.ObjectContext.EmployeeHistoryEntries.AttachAsModified(currentEmployeeHistoryEntry); }
/// <summary> /// Deprecated Method for adding a new object to the EmployeeHistoryEntries EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToEmployeeHistoryEntries(EmployeeHistoryEntry employeeHistoryEntry) { base.AddObject("EmployeeHistoryEntries", employeeHistoryEntry); }
public void InsertEmployeeHistoryEntry(EmployeeHistoryEntry employeeHistoryEntry) { if ((employeeHistoryEntry.EntityState != EntityState.Detached)) { this.ObjectContext.ObjectStateManager.ChangeObjectState(employeeHistoryEntry, EntityState.Added); } else { this.ObjectContext.EmployeeHistoryEntries.AddObject(employeeHistoryEntry); } }
/// <summary> /// Create a new EmployeeHistoryEntry object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="employeeId">Initial value of the EmployeeId property.</param> /// <param name="createdDate">Initial value of the CreatedDate property.</param> public static EmployeeHistoryEntry CreateEmployeeHistoryEntry(global::System.Guid id, global::System.Guid employeeId, global::System.DateTime createdDate) { EmployeeHistoryEntry employeeHistoryEntry = new EmployeeHistoryEntry(); employeeHistoryEntry.Id = id; employeeHistoryEntry.EmployeeId = employeeId; employeeHistoryEntry.CreatedDate = createdDate; return employeeHistoryEntry; }