1

Anyone know how to represent this as an Entity Framework query? Either method syntax or query syntax is fine.

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)

1 Answer 1

1

Given a variable 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
}
Sign up to request clarification or add additional context in comments.

1 Comment

Awesome! Never thought to change the query! Works like a champ thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.