public void InsertImportant_part(important_part important_part) { if ((important_part.EntityState != EntityState.Detached)) { this.ObjectContext.ObjectStateManager.ChangeObjectState(important_part, EntityState.Added); } else { this.ObjectContext.important_part.AddObject(important_part); } }
public void DeleteImportant_part(important_part important_part) { if ((important_part.EntityState != EntityState.Detached)) { this.ObjectContext.ObjectStateManager.ChangeObjectState(important_part, EntityState.Deleted); } else { this.ObjectContext.important_part.Attach(important_part); this.ObjectContext.important_part.DeleteObject(important_part); } }
public void UpdateImportant_part(important_part currentimportant_part) { this.ObjectContext.important_part.AttachAsModified(currentimportant_part, this.ChangeSet.GetOriginal(currentimportant_part)); }