2

I have the following table structure....

  • Pilots
  • Operators
  • Ranks

Pilots/Operations - there are multiple pilots to one operator.

Ranks: 1) Captain 2) First Officer

Each operator then defines its own rank criteria (hours required etc).

So to get the actual name of the rank I need to join from Pilots -> Operators -> Ranks.

I would like to do this with LoadWith e.g.

options.LoadWith<Pilot>(x => x.Operator);

How to now make it also eager load the ranks? The above statement only causes a join to Operators.

Thanks.

1 Answer 1

3

If you want to go down the differed loading path, than you would do the same for your Ranks:

 options.LoadWith<Pilot>(x => x.Operator);
 options.LoadWith<Operators>(y=>y.Rank);
 yourDataContext.LoadOptions = options;

Then you can also always do the join with linq as well as the LoadOptions is known to produce very inefficient queries.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.