I have a class

public class Evaluation { public string StudentId { get; set; } public int SubjectId { get; set; } public string InstructorId { get; set; } public virtual Student Student { get; set; } public virtual Subject Subject { get; set; } public virtual Instructor Instructor { get; set; } public int Score { get; set; } } 

and in the table need keys. I'm still very tense with the DB, so I haven’t yet got into the mysteries of key placement.

 modelBuilder.Entity<Evaluation>().HasKey(e => new { e.StudentId, e.SubjectId, e.InstructorId }); 

In context, I try to do it this way, but writes that this game causes looping or multiple cascading:

Introducing FOREIGN KEY constraint 'FK_dbo.Evaluations_dbo.AspNetUsers_StudentId' on table 'Evaluations' may cause cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY constraints.
And now I’m not sure what to do ...

  • More information about the relationship between the tables can be found here link . Should help! - Alexey

0