Reputation: 4484
I need guidance with what I think is a complex Entity Framework 4.1 table query.
An item has a list of associated Identities. A user then has a list of Identities that can be selected. So I'd like to only return items that have identities that are in the user's list and are selected. Any suggestions on how to best tackle this? Thanks in advance
Upvotes: 0
Views: 300
Reputation: 160902
Something like this:
var results = db.UserIdentities
.Where( x => x.UserId == someUserId && x.Selected)
.Select( x => x.Identity.Item);
Upvotes: 2