Guest User

Untitled

a guest
Jan 23rd, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. var roles = User.FindAll(ClaimTypes.Role).Select(r=>r.Value);
  2.  
  3. var groupsQuery = dbContext.Groups.Where(g=>roles.Any(r=>r==g.GroupName));
  4. var groups = await groupsQuery.ToListAsync();
  5.  
  6. var assetGroupsQuery = dbContext.AssetsGroups.Where(ag => groupsQuery.Any(ag => ag.Id == a.GroupId));
  7. var assetGroups = await assetGroupsQuery.ToListAsync();
  8.  
  9. The LINQ expression 'where ([ag].Id == [ag].GroupId)' could not be translated and will be evaluated locally.
  10. The LINQ expression 'Any()' could not be translated and will be evaluated locally.
  11. The LINQ expression 'where {from Group g in __groups_0 where ([ag].Id == [ag].GroupId) select [ag] => Any()}' could not be translated and will be evaluated locally.
  12. The LINQ expression 'where ([ag].Id == [ag].GroupId)' could not be translated and will be evaluated locally.
  13. The LINQ expression 'Any()' could not be translated and will be evaluated locally.
Add Comment
Please, Sign In to add comment