1

任何人都知道如何将其表示为实体框架查询?方法语法或查询语法都可以。

Declare @UserId int = 18

Select *
From [Profiles]
Where [Profiles].[ProfileId] 
IN( Select [SecurityProfileAssignments].[ProfileId]
    From [SecurityProfileUsers]
    Join [SecurityProfileAssignments] On [SecurityProfileAssignments].[SecurityProfileId] = [SecurityProfileUsers].[SecurityProfileId]
    Where [SecurityProfileUsers].[UserId] = @UserId)
4

1 回答 1

1

给定一个变量 userId:

from p in Profiles
join spa in SeucrityProfileAssignments
    on p.ProfileId equals spa.ProfileId
join spu in SecurityProfileUsers
    on spa.SecurityProfileId equals spu.SecurityProfileId
where spu.UserId = userId
select new //optional object type
{
    //values to select
}
于 2014-07-17T19:49:17.797 回答