RavenDB 包含 - Session.Load<T>(string[] ids) [英] RavenDB Include - Session.Load&lt;T&gt;(string[] ids)

查看:27
本文介绍了RavenDB 包含 - Session.Load<T>(string[] ids)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么我不能执行 Include 以包含来自查询的文档集合,然后在一个查询中将它们全部加载,而不是使用 for 循环.

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,我刚刚为此提交了一个拉取请求.我想您会在即将发布的版本之一中找到它.

Paul, I just submitted a pull-request for that. I guess you will find this in one of the upcoming builds.

这篇关于RavenDB 包含 - Session.Load<T>(string[] ids)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆