Beispiel #1
0
 /// <summary>
 /// Service method to update patient
 /// </summary>
 /// <param name="patient">patient</param>
 /// <returns>true / false</returns>
 public bool Update(PatientEntity patient)
 {
     using (var context = new FHIRDbContext())
     {
         context.Patients.Attach(patient);
         context.Entry(patient).State = EntityState.Modified;
         return(context.SaveChanges() > 0);
     }
 }
Beispiel #2
0
 /// <summary>
 /// Method to soft delete a patient
 /// </summary>
 /// <param name="id">patient id</param>
 /// <returns>true / false</returns>
 public bool Delete(int id)
 {
     using (var context = new FHIRDbContext())
     {
         var patient = context.Patients.Find(id);
         patient.SoftDelete = true;
         context.Patients.Attach(patient);
         context.Entry(patient).State = EntityState.Modified;
         return(context.SaveChanges() > 0);
     }
 }