These linq queries are translated into the same sql query

from portfolio in Session.Current.Query.All<Portfolio>() select portfolio


from portfolio in Session.Current.Query.All<Portfolio>()
.Prefetch(p => new { p.Status, p.Fund, p.ManagementCompany })
select portfolio

But this linq query leads to the desired result

from portfolio in Session.Current.Query.All<Portfolio>()
                                  .Prefetch(p => p.Status)
                                  .Prefetch(p => p.Fund)
                                  .Prefetch(p => p.ManagementCompany)
                              select portfolio

asked Jan 26 '12 at 03:30

Ibanez's gravatar image


edited Jan 26 '12 at 03:45

Dmitri%20Maximov's gravatar image

Dmitri Maximov

Hello Ibanez, welcome on board =)

Am I right saying that p.Fund, p.ManagementCompany and p.Status are reference fields?


(Jan 26 '12 at 03:44) Dmitri Maximov Dmitri%20Maximov's gravatar image

You are right

(Jan 26 '12 at 04:35) Ibanez Ibanez's gravatar image

OK, I see. We'll check this. Thanks for reporting.

(Jan 26 '12 at 05:21) Dmitri Maximov Dmitri%20Maximov's gravatar image

One Answer:

Hello Ibanez,

the bug is fixed. It will be included in the upcoming release of v4.4.2

answered Jan 30 '12 at 11:12

Denis%20Krjuchkov's gravatar image

Denis Krjuchkov

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

powered by OSQA