我有以下 2 节课
public class Student
{
public string Name { get; set; }
public int SchoolId { get; set; }
}
public class School
{
public int SchoolId { get; set; }
public IList<Student> Students { get; set; }
}
SchoolId在类内部添加可能很奇怪,Student但我们这样做是为了跟踪。
在数据库中Students,我们有一个包含StudentName和schoolId
我们如何Schools通过从此表中选择所有来重建列表