title: How to get Role Claims?
body: <p>I've created a user and attached to him a role that has a number of claims. The problem is I don't see a direct way to access retrieve them using Entity Framework Core and Identity integration. Here's what I'd like to do ideally:</p>
  
  <pre><code>return _context.Users
    .Include(u =&gt; u.Roles)
    .ThenInclude(r =&gt; r.Role)
    .ThenInclude(r =&gt; r.Claims)
  </code></pre>
  
  <p>But there's not Role property, just RoleId. So I can not Include role claims. Of course I get make a separate query to get claims or even use RoleManager:</p>
  
  <pre><code>var user = _context.Users.Single(x =&gt; x.Id == ...);
  var role = _roleManager.Roles.Single(x =&gt; x.Id ==  user.Roles.ElementAt(0).RoleId);
  var claims = _roleManager.GetClaimsAsync(role).Result;
  </code></pre>
  
  <p>but it looks inefficient and even ugly. There should be a way to make a single query.    </p>
  
  <p>My last hope was Controller.User property (ClaimsIdentity). I hoped it somehow smartly aggregates claims from all the roles. But seems like it doesn't...</p>