I have read information about how to extend Identity with and additional fields, connected to the user's profile.
But I can not understand how to extend Identity functionality by adding a table, connected with Roles.
What I want to do:
- My MVC application should consists of some sub-applications.
- I want users to be identified by roles and redirected to the needed sub-application.
- Inside sub-application they can have different roles (admin, user, etc.)
- So all roles are listed in the Identity Role table (AspNetRoles).
- Now I need to add to AspNetRoles one extra field, that points to the new table with the sub-application names.
The new class of sub-application is:
public class Project
{
public int ID { get; set; }
[StringLength(100)]
public string ProjectName { get; set; }
// How can the foreign key to AspNetRoles be added ?
}
Can you help to add a foreign key to AspNetRoles table, please?