Пример #1
0
 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);
     }
 }
Пример #2
0
 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);
     }
 }
Пример #3
0
 public void UpdateImportant_part(important_part currentimportant_part)
 {
     this.ObjectContext.important_part.AttachAsModified(currentimportant_part, this.ChangeSet.GetOriginal(currentimportant_part));
 }