Can't Include navigation property (it is null) [duplicate]
问题 This question already has answers here : How to stop self-referencing loop in .Net Core Web API? (3 answers) Closed last year . I am trying to get the students from the database and also include the course entities corresponding to them, but it seems that I'm doing something wrong. this is student class: public class Student { public int StudentID { get; set; } public string Name { get; set; } public int CourseID { get; set; } public virtual Course Course { get; set; } } this is course class: