I'm trying to extend AbpUserRoles
in order to add new column into it. I was able to do that as following:
public class MyUserRole : Abp.Authorization.Users.UserRole
{
public int MyCustomColumn { get; set; }
public MyUserRole() { }
public MyUserRole(int tenantId, long userId, int roleId, int myCustomColumnId)
:base(tenantId, userId, roleId)
{
this.MyCustomColumn = myCustomColumnId;
}
}
After above code, I added and updated migrations, and MyCustomColumn
appeared in database.
Questoin: But I'm not getting how to use it. I tried registering it in my WebModule as IRepository<MyUserRole>
and tried injecting it in RoleManager
, but it did not work. I'm banging my head with this since last day, and seems there's something obvious I'm missing. Or it is not even possible?