RavenDB Include - Session.Load<T>(string[] ids)

大兔子大兔子 提交于 2019-12-07 07:38:50

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!