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)。
我怎样才能做到这一点?