{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/Identity/issues/1361","repository_url":"https://api.github.com/repos/aspnet/Identity","labels_url":"https://api.github.com/repos/aspnet/Identity/issues/1361/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/Identity/issues/1361/comments","events_url":"https://api.github.com/repos/aspnet/Identity/issues/1361/events","html_url":"https://github.com/aspnet/Identity/issues/1361","id":250295622,"number":1361,"title":"How to include Roles in IdentityUser?","user":{"login":"andrew-vandenbrink","id":12871379,"avatar_url":"https://avatars1.githubusercontent.com/u/12871379?v=4","gravatar_id":"","url":"https://api.github.com/users/andrew-vandenbrink","html_url":"https://github.com/andrew-vandenbrink","followers_url":"https://api.github.com/users/andrew-vandenbrink/followers","following_url":"https://api.github.com/users/andrew-vandenbrink/following{/other_user}","gists_url":"https://api.github.com/users/andrew-vandenbrink/gists{/gist_id}","starred_url":"https://api.github.com/users/andrew-vandenbrink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrew-vandenbrink/subscriptions","organizations_url":"https://api.github.com/users/andrew-vandenbrink/orgs","repos_url":"https://api.github.com/users/andrew-vandenbrink/repos","events_url":"https://api.github.com/users/andrew-vandenbrink/events{/privacy}","received_events_url":"https://api.github.com/users/andrew-vandenbrink/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":33,"created_at":"2017-08-15T12:02:42Z","updated_at":"2018-02-19T12:38:43Z","closed_at":"2017-08-18T06:19:21Z","author_association":"NONE","body":"https://github.com/aspnet/Identity/commit/f555a26b4a554f73eea70b4b34fca823fab9a643\r\n\r\nI see the change by making roles optional....\r\nAs I need to use the roles in IdentityUser, how can I do that?\r\nNot using compatibility namespace I hope..."},"comment":{"url":"https://api.github.com/repos/aspnet/Identity/issues/comments/366681645","html_url":"https://github.com/aspnet/Identity/issues/1361#issuecomment-366681645","issue_url":"https://api.github.com/repos/aspnet/Identity/issues/1361","id":366681645,"user":{"login":"andrew-vandenbrink","id":12871379,"avatar_url":"https://avatars1.githubusercontent.com/u/12871379?v=4","gravatar_id":"","url":"https://api.github.com/users/andrew-vandenbrink","html_url":"https://github.com/andrew-vandenbrink","followers_url":"https://api.github.com/users/andrew-vandenbrink/followers","following_url":"https://api.github.com/users/andrew-vandenbrink/following{/other_user}","gists_url":"https://api.github.com/users/andrew-vandenbrink/gists{/gist_id}","starred_url":"https://api.github.com/users/andrew-vandenbrink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrew-vandenbrink/subscriptions","organizations_url":"https://api.github.com/users/andrew-vandenbrink/orgs","repos_url":"https://api.github.com/users/andrew-vandenbrink/repos","events_url":"https://api.github.com/users/andrew-vandenbrink/events{/privacy}","received_events_url":"https://api.github.com/users/andrew-vandenbrink/received_events","type":"User","site_admin":false},"created_at":"2018-02-19T12:38:43Z","updated_at":"2018-02-19T12:38:43Z","author_association":"NONE","body":"To people who say it doesn't work, it works, just read the thread properly...\r\n\r\nOnce you make it work, you can make a query to show users and its role\r\n```\r\nvar roles = roleManager.Roles.ToDictionary(r=>r.Id,r=>r.Name);\r\n                                \r\nvar usersWithRoles = userManager.Users.Include(u=>u.Roles).AsEnumerable().Select(u =>\r\n{                    \r\n  var obj=(JObject)JToken.FromObject(u);\r\n  var rolesName= string.Join(\",\",u.Roles.Select(r=>roles[r.RoleId]).ToArray());\r\n  obj[\"Roles\"]=rolesName;                    \r\n  return obj;\r\n } \r\n); \r\n```"}}
{"actor":{"display_login":"andrew-vandenbrink"}}