I have added the patient and visit tables in reg_visit
table in Entity Framework 6.1 code-first
but when run the below code, I get this error:
Validation failed for one or more entities. See 'EntityValidationErrors' property for more details.
Code:
Models.VisitDoctotDb oVisitdb = new Models.VisitDoctotDb();
Models.RegVisit oReg_visit = new Models.RegVisit();
oReg_visit.Patient = oPatient;
oReg_visit.Visit = oVisit;
oVisitdb.Reg_visit.Add(Reg_visit); ===> error
oVisitdb.SaveChanges();