Convert this Linq query from query syntax to lambda expression

Posted by Jinkinz on Stack Overflow See other posts from Stack Overflow or by Jinkinz
Published on 2010-05-21T02:21:21Z Indexed on 2010/05/21 2:30 UTC
Read the original article Hit count: 380

I'm not sure I like linq query syntax...its just not my preference. But I don't know what this query would look like using lambda expressions, can someone help?

from securityRoles in user.SecurityRoles
from permissions in securityRoles.Permissions
where permissions.SecurableEntity.Name == "Unit" && permissions.PermissionType.Name == "Read"
orderby permissions.PermissionLevel.Value descending
select permissions

There is a many-to-many relationship between users and security roles that makes this extra confusing.

Thanks! Kelly

© Stack Overflow or respective owner

Related posts about linq-query-syntax

Related posts about lambda-expressions