hello mvc users,
i cant understand that error
The DELETE statement conflicted with the REFERENCE constraint "FK_dbo.Appointments_dbo.Patients_PatientId". The conflict occurred in database "ClinicDB", table "dbo.Appointments", column 'PatientId'.
The statement has been terminated. And
And in patient configuration class
there is code below
HasMany(p => p.Appointments)
.WithRequired(a => a.Patient)
.WillCascadeOnDelete(true);
what else ? anything
how to fix this prob?

Sundaram SubramanianRank #150 · 15.2K reputationPosted Jan 12, 2020, 10:45 PM EST
sonal malhotraRank #4,317 · 351 reputationPosted Jan 12, 2020, 10:49 PM EST
Sundaram SubramanianRank #150 · 15.2K reputationPosted Jan 12, 2020, 10:51 PM EST
sonal malhotraRank #4,317 · 351 reputationPosted Jan 12, 2020, 11:35 PM EST
Sundaram SubramanianRank #150 · 15.2K reputationPosted Jan 12, 2020, 11:40 PM EST
sonal malhotraRank #4,317 · 351 reputationPosted Jan 12, 2020, 11:42 PM EST
Sundaram SubramanianRank #150 · 15.2K reputationPosted Jan 12, 2020, 11:43 PM EST
sonal malhotraRank #4,317 · 351 reputationPosted Jan 12, 2020, 11:45 PM EST
sonal malhotraRank #4,317 · 351 reputationPosted Jan 12, 2020, 11:55 PM EST
sonal malhotraRank #4,317 · 351 reputationPosted Jan 13, 2020, 12:07 AM EST
Sundaram SubramanianRank #150 · 15.2K reputationPosted Jan 13, 2020, 12:42 AM EST