KentZhou
KentZhou

Reputation: 25553

how to write parameter string for include for linq query?

If table Employee has foreign key for table person, department, when get the entity of employee, I want to both associated entities loaded too. how to write the linq query? like below?

var employee = this.Context.Employee.Include("Person, Department");

It seems not working.

Upvotes: 0

Views: 275

Answers (1)

Ben M
Ben M

Reputation: 22492

var employee = this.Context.Employee.Include("Person").Include("Department");

Upvotes: 1

Related Questions