Advertisement
Guest User

Untitled

a guest
Jul 1st, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. public class PatientModel
  2. {
  3. public Guid ID { get; set; }
  4. public virtual PatientMedicalHistoryModel PatientMedicalHistory { get; set; }
  5. }
  6. public class PatientMedicalHistoryModel
  7. {
  8. public Guid ID { get; set; }
  9. public virtual PatientModel Patient { get; set; }
  10. }
  11.  
  12. modelBuilder.Entity<PatientMedicalHistoryModel>().HasRequired(r => r.Patient).WithOptional(o => o.PatientMedicalHistory);
  13.  
  14. //this.PatientMedicalHistory.ID = patient.ID;
  15. patient.PatientMedicalHistory = new PatientMedicalHistoryModel()
  16. {
  17. HasHyperTension = this.PatientMedicalHistory.HasHyperTension,
  18. HyperTensionMedication = this.PatientMedicalHistory.HyperTensionMedication
  19. };
  20.  
  21. ServiceFactory.PatientService().updatePatient(patient, oldPatient);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement