问题
Is there a reason why I can't perform an Include to include a collection of documents from a query, then load them all in one query, rather than using a for-loop.
var messages = Session.Query<MessageRecipient, MessageInboxIndex>()
.Include(x => x.MessageId)
.ToList();
Session.Load<Message>(messages.Select(x => x.MessageId));
This seems to go back to the database to fetch the objects rather than use the cache...is this by design or can it be fixed?
Paul
回答1:
Paul, I just submitted a pull-request for that. I guess you will find this in one of the upcoming builds.
回答2:
Paul, That is because the optimization isn't implemented, that is all. A pull request for that would be appreciated.
来源:https://stackoverflow.com/questions/9049408/ravendb-include-session-loadtstring-ids