I searched a bit and understands that I can use projection to partially load an entity , the question becomes is there a way to partially eager loading a child? Say I have the following
Entity A has
Id
Name
EntityB
and Entity B has
Id
StuffToBeLoaded1
StuffToBeLoaded2
OtherStuffNotToBeLoaded
How can I load A with B , and B only has stuffToBeLoaded1 and stuffToBeLoaded2? I guess I cannot call .Inlucde("EntityB") otherwise it is fully loaded, is it?
You must use custom query with a projection. If
EntityB
property represents collection you can use something like:If
EntityB
is not a collection navigation property you can simply use: