0

I have table Employer and EmployerParam. Almost needless to say 1 Employer has 1 to many EmployeeParams. I want that every time an Employee is loaded, its EmployeeParams are included, i.e. eager-loaded.

The only other was I can think of is using a repository method, but that can always be bypassed and the Employer loaded without Params.

ProfK
  • 49,207
  • 121
  • 399
  • 775

1 Answers1

0

There is no configuration for eager loading. You always have to call the Include method. For example in a helper method.

 return this.Employer.Include(e => e.EmployeeParams);
dm88
  • 382
  • 2
  • 13