When using Include()
in my LINQ against my model should the path parameter I supply be the name of the related objects or the name of the Navigation Property?
I ask because the same table has more than one relationship to the same other table. I note in the designer the navigation properties of related table are in the form:
RelatedTable
RelatedTable1
...
RelatedTablen
Lazy loading is off so I need to explicitly load related objects. I am only want the objects related through the Navigation Property: "RelatedTable1" I have tried supplying the Navigation Property name (i.e. "RelatedTable1") to Include, i.e.:
from row in Table.Include("RelatedTable1")
select row
and it works! Which suggests the path parameter should be the name of the Navigation Property. However I have also tried just the related Entity's name, i.e.:
from row in Table.Include("RelatedTable")
select row
and it works too! I am just asking to understand what is going on..
(LazyLoading is off and if I do not use Include() related is not fetched).