Using Maxtoroq's DBExtensions how can we map an object having list of elements as child property
using just one sql builder?
My sample DB structure
Employee
EmployeeId
FirstName
LastName
Department
DeptId
DeptName
EmployeeDepartment
EmployeeId
DeptId
My POCO
class Department{
public int DeptId {get;set;}
public string DeptName {get;set;}
}
class Employee {
public void Employee(){
Depts = new List<Department>();
}
public int EmployeeId {get;set;}
public string FirstName {get;set;}
public string LastName {get;set;}
public List<Department> Depts {get;set;}
}
ここで、SqlBuilder を使用して db に対してクエリを一度に実行することにより (db への複数の呼び出しではなく)、関連付けられているすべての部門を含む User のインスタンスを作成したいと考えています。
どうやってやるの?