Reputation: 1611
I'm currently working on a small prototype using the Netflix OData api. I would like to always load entities eagerly. In other words, I don't want to "Expand" properties specifically. Rather I would like to just load all the properties of a given entity when that entity is fetched. I'm not asking for design or architectural advice here. I know the implications of doing this. Is there a way to turn on eager loading at the Context level?
Thanks
Upvotes: 1
Views: 1510
Reputation: 13320
As Mark noted above, this is not currently possible with any built-in feature of the WCF Data Services. You could inject the $expand into the URL on the client using some code so that it looks like you don't have to do it explicitly though.
The problem with some generic solution is:
You could also modify your client-side classes to lazy load the property on access. There's an API DataServiceContext.LoadProperty, so just call that in the right spot.
Upvotes: 2