I want to be able to extend the default implementation of IdentityRole to include fields like Description. It\'s easy enough to do this for IdentityUser because IdentityDbCo
UserManager
uses UserStore
as its user store (IUserStore
). UserManager
works with UserStore
for adding and removing user to a role name
as IUserRole.
Likewise, there are interfaces IRole
& IRoleStore
for IdentityRole
and RoleStore
where TRole
is IdentityRole
. This is to work plainly with Roles directly.
So you can inherit IdentityRole
and add additional information. Use RoleStore
to manage it along additional information.
RoleManager
provides core interaction methods for Role, which can use MyRoleStore.
MyIdentityRole.cs
public class MyIdentityRole: IdentityRole
{
public String Description { get; set;}
}