开发者

Entity Framework multi table query

开发者 https://www.devze.com 2023-04-11 13:19 出处:网络
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

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

Entity Framework multi 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


Something like this:

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

精彩评论

暂无评论...
验证码 换一张
取 消