Skip to content
Discussion options

You must be logged in to vote

The index you are using has nothing to do with this.
What you want to do is something like:

  var myThings = await session
            .Query<MyThing>()
            .Select(t => new {
                      t.Id,
                      t.Name,
                      Reference = new { t.Reference.Id, t.Reference.ReferenceType, DisplayName = session.Load<IReference>(t.Reference.Id).DisplayName }
            })
            .ToListAsync();

Basically, your issue is that you have DisplayName being different across collections, you can add a interface type that would manage that for you, and it will work.

Replies: 4 comments 6 replies

Comment options

You must be logged in to vote
2 replies
@LUS1N
Comment options

@ayende
Comment options

Comment options

You must be logged in to vote
2 replies
@ayende
Comment options

Answer selected by LUS1N
@LUS1N
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@LUS1N
Comment options

@ayende
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants