You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class ContactInfo
{
public string Email { get; set; }
public string PhoneNumber { get; set; }
}
class Person
{
public Guid Id { get; set; }
public string Name { get; set; }
public List<ContactInfo> ContactInfos { get; set; }
}
class PersonListItem
{
public Guid Id { get; set; }
public string Name { get; set; }
public List<string> PhoneNumbers { get; set; }
}
Given the classes above, I would like to have a list of Person's with per person a list of PhoneNumbers. So:
var persons = _session.Query<Person>()
.Select(x => new PersonListItem()
{
Id = x.Id,
Name = x.Name,
PhoneNumbers = x.ContactInfos.Select(y => y.PhoneNumber).ToList()
});
But I'm getting the exception: No members found in this Expression (Parameter 'members')
I'm new to Marten, so maybe I'm missing something? Doing something wrong?
In this example it's an option to just load all since the objects are small, however I'm working with bigger structures where I don't want to load the whole document when using it for a list.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Given the classes above, I would like to have a list of Person's with per person a list of PhoneNumbers. So:
But I'm getting the exception: No members found in this Expression (Parameter 'members')
I'm new to Marten, so maybe I'm missing something? Doing something wrong?
In this example it's an option to just load all since the objects are small, however I'm working with bigger structures where I don't want to load the whole document when using it for a list.
Beta Was this translation helpful? Give feedback.
All reactions