Get user with assigned roles
<p>Using ASP.NET Core identity, I create a new user with <code>UserManager.CreateAsync()</code> and assign them to an existing role with <code>UserManager.AddToRoleAsync</code>. This works, as the realtion between user and role is stored in the <code>AspNetUserRoles</code> table of the database. </p>

<p>But when I fetch the user using the UserManager (e.g. <code>UserManager.FindByMail()</code> method) then the <code>Role</code> list is empty. I also tried the <code>Include</code> function from EF like this: </p>

<pre><code>var user = userManager.Users.Include(u =&gt; u.Roles).FirstOrDefault(u =&gt; u.Email == "test@test.de");
</code></pre>

<p>This gave me the Ids of the n:m association table, which is not very usefull as I need the role names. Loading them using a second query is also not possible, since the <code>Roles</code> attribute of the identity user is readonly. I would expect to get a <code>List&lt;string&gt;</code> of the role-names. Couldn't find any information about this. </p>

<p>For me the only workaround seems to add a custom attribute to my user and fill them with the data, which I fetch using a second query. But thats not a nice solution. Cant belive that ASP.NET Core Identity has no better way of getting those data...</p>