I have an MSSQL storedproc, which I’m executing via EF4 through the context. This results an IEnumerable<T>, which returns and deserializes all the result from the SP.
The problem is, that I want to do eager loading on some of the navigation properties.
Calling .AsQueryable().Include("Navigation_Property_Path").ToArray() does not help.
Is there any way to eager load navigation properties of entities already in the context?
I don’t really want to alter my SP, to return IDs of my entities (basically int array), and then execute select on the EF.Context using the ID for WHERE, and then using the Include.
No, because SP invocation is not composable at the SQL level. EF does not support eager loading for that.
Maybe you can switch from an SP to an inline TVF?