Reference()和Collection() 方法

 

IList<Student> studList = context.Students.ToList<Student>();

Student std = studList.Where(s => s.StudentID == 1).FirstOrDefault<Student>();

 

//Loads Standard for particular Student only (seperate SQL query)

context.Entry(std).Reference(s => s.Standard).Load();

 

//Loads Courses for particular Student only (seperate SQL query)

context.Entry(std).Collection(s => s.Courses).Load();

相关文章:

  • 2021-08-08
  • 2021-06-20
  • 2021-11-29
  • 2021-07-24
  • 2022-02-24
  • 2021-11-18
  • 2022-01-14
  • 2021-09-19
猜你喜欢
  • 2021-05-24
  • 2022-12-23
  • 2021-08-04
  • 2021-11-27
  • 2021-12-24
  • 2021-12-28
  • 2022-12-23
相关资源
相似解决方案