Is something like Prefetch available for Query.All(Type)?.. or it is available only for generics?

asked May 19 '11 at 11:25

Janosh's gravatar image


One Answer:

Hello Janosh,

Prefetch extension methods are generic only, all of them use Expressions that are also generic. Consider calling generic Prefetch methods through Reflection, this might be simpler than runtime Expression building.

answered May 20 '11 at 04:49

Dmitri%20Maximov's gravatar image

Dmitri Maximov

I have wcf client and service and would like to pass the prefetch condition from client to the service to avoid new method creation each time when i need different set of data. Is it possible? Using reflection i can prefetch only one complex property. And i'm not sure that using reflection i can do something like Query.All<t>().Prefetch(x=>x.ComplexProp1).Prefetch(x=>x.ComplexProp2.ComplexProp3)

(May 20 '11 at 08:48) Janosh Janosh's gravatar image

While speaking about the Reflection I meant the obtaining of a generic method of prefetch and then using it as usual.

Janosh, could you send me your sample project so I could play with it a bit? This might save hours of discussions here.

(May 20 '11 at 11:36) Dmitri Maximov Dmitri%20Maximov's gravatar image
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview


Once you sign in you will be able to subscribe for any updates here



Asked: May 19 '11 at 11:25

Seen: 2,738 times

Last updated: May 20 '11 at 11:36

powered by OSQA