Linq where clause is not in select statement
2 answers
I find my own answer ...
'construct a where ID list
Dim lstRoleIDs = From ur In ctx.UsersRoles _
Join rl In ctx.Roles _
On ur.RoleID Equals rl.ID _
Where ur.User_ID = UserId _
Select rl.ID
Dim newQ = (From r In ctx.Roles _
Where Not lstRoleIDs.Contains( _
r.ID) _
Select New UserRoleList With {.ID = r.ID, .PermDesc = r.ID & " - " & r.Permission & " - " & r.PermissionDescription})
+2
Annie
source
to share
If you want to keep prompts (NOLOCK) I wrote a good solution using extension methods in C #. Note that this is the same as adding nolock hints to every table in the query.
0
source to share