コード例 #1
0
        public void DeletePatient(global::ApplicationData.Implementation.Patient entity)
        {
            if (entity.EntityState == global::System.Data.EntityState.Detached)
            {
                this.ObjectContext.Patients.Attach(entity);
            }

            this.DeleteEntity(entity);
        }
コード例 #2
0
 public void InsertPatient(global::ApplicationData.Implementation.Patient entity)
 {
     if (entity.EntityState != global::System.Data.EntityState.Detached)
     {
         this.ObjectContext.ObjectStateManager.ChangeObjectState(entity, global::System.Data.EntityState.Added);
     }
     else
     {
         this.ObjectContext.Patients.AddObject(entity);
     }
 }
コード例 #3
0
 public void UpdatePatient(global::ApplicationData.Implementation.Patient currentEntity)
 {
     global::System.ServiceModel.DomainServices.EntityFramework.ObjectContextExtensions.AttachAsModified(this.ObjectContext.Patients, currentEntity, this.ChangeSet.GetOriginal(currentEntity));
 }