By default if the table has FK, subsonic also retrieves data of the FK table. Is it possible to disable this?
A:
If you ask for rows of data from a particular table, SubSonic will only give you the rows from that table, even if it has foreign keys out to other tables. e.g.
EmployeeCollection employees = new EmployeeCollection().Load();
If you want the data from a related table (via a foreign key), you would have to follow the references to the other tables, incurring the trip to the database. e.g.
foreach(Employee e in employees){
Debug.Print(e.Department.DepartmentName);
}
where Department is the related foreign key table and DepartmentName is a column in that table.
sparks
2010-01-23 03:52:28