Suppose I have a couple of table:
person(personid, name, email)
employee(personid,cardno, departmentID) //personid,departmentID is foreign key
department(departmentID, departmentName)
employeePhone(personID, phoneID) //this is relationship table
phone(phoneID, phonenumer)
When EntityFramework generate entity class for employee, this class have members like:
public partial class employee{
int _personid;
string _cardno;
string _departmentName;
person _person;
department _department;
//......
}
by default, when this class is loaded, only data available for employee table column, not data for associated entities data loaded. If I use Linq to get the data at client side, Include should be used for linq query.
My question is: I want to the associated entities data loaded at server side when the employee is instantiated at server side. So when I get the entity at client side, all data available already so that I can easy to bind it to UI.
How to implement this request?