Both of the following queries work as expected. I'm having trouble figuring out how to return both from the database in one pull using the "Include()" method.
var result = _documentsSession
.Advanced
.LuceneQuery<MessageStatisticResult, MessageSummaryByUserIndex>()
.Where("Email:" + command.UserName);
var user = _documentSession
.Load<IUser>("users/" + command.UserName);
A soon as I add the "Include()" method both the Query() and A开发者_如何学Pythondvance() are no longer relevant. Is there a way to do this?
This also produces results but does not get both in one trip to the database:
var result = _documentsSession
.Query<MessageStatisticResult, MessageSummaryByUserIndex>()
.Customize(x => x.Include("users/" + command.UserName))
.Where(x => x.Email == command.UserName)
.FirstOrDefault();
var user = _documentSession
.Load<IUser>("users/" + command.UserName);
The final answer was to delete my RavenDB code and reclone from git and rebuild. Then it worked just fine.
精彩评论