NullReference
NullReference

Reputation: 4484

Entity Framework multi table query

I need guidance with what I think is a complex Entity Framework 4.1 table query.

enter image description here

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

Answers (1)

BrokenGlass
BrokenGlass

Reputation: 160902

Something like this:

var results = db.UserIdentities
                .Where( x => x.UserId == someUserId && x.Selected)
                .Select( x => x.Identity.Item);     

Upvotes: 2

Related Questions