[table]表一
Student
{
[PrimaryKey]
Id,
Name,
ClassID 外键 --
[Association] |
classId |
} |
|
[table]表二 |
Class |
{ |
[PrimaryKey] |
Id, <------
Name,
[Association]
students
}
from n in students.LoadWith(student=>student.classId)
select n;
更多例子:
https://github.com/linq2db/linq2db/blob/bf1b0f83c43ef64491cc6892445a13ba115ceac5/Tests/Linq/Linq/LoadWithTests.cs