locked
Create Role in ASP.NET Identity and Add User To That Role RRS feed

  • Question

  • User-1835835255 posted

    I created a user in asp.net identity how do I create the role and then add the user to the role?

    The tables for the users in asp.net identity are AspNetRoles, AspNetUserRoles, and AspNetUsers tables

    Thanks

    Sunday, May 15, 2016 12:43 AM

Answers

  • User-1835835255 posted

    I figured this one out.  You have to go to ...

    1) Create the User

    2) go to ASPNetRoles table in database then create the role

         ID     |     Name

          1              Admin

    3) Assign the role to the user in database

         UserID     |     RoleID

      [youruserid]         1

    Voila, now you have created a role for a user.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, May 15, 2016 3:27 AM