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:

  1. My MVC application should consists of some sub-applications.
  2. I want users to be identified by roles and redirected to the needed sub-application.
  3. Inside sub-application they can have different roles (admin, user, etc.)
  4. So all roles are listed in the Identity Role table (AspNetRoles).
  5. 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?

Related posts

Recent Viewed