Example #1
0
 public static void AddSingleRelationship(DataBaseContext context, DbTreatmentHistory treatmentHistory, DbTreatment treatment)
 {
     context.TreatmentHistories.SingleOrDefault(th => th.Id == treatmentHistory.Id).Treatments.Add(context.Treatments.SingleOrDefault(t => t.Id == treatment.Id));
 }
Example #2
0
 public static void AddSingleRelationship(DataBaseContext context, DbTreatmentHistory treatmentHistory, DbPatient patient)
 {
     context.Patients.SingleOrDefault(p => p.Id == patient.Id).TreatmentHistory = context.TreatmentHistories.SingleOrDefault(th => th.Id == treatmentHistory.Id);
 }