How to store different sets of user information using ASP.NET MVC Simple Memberships

115 Views Asked by At

How do I store different sets of user information using Simple Memberships? For eg. I have two roles (doctors and patients) respectively. The extended user information to be stored for both the roles is somewhat different. Simple Membership creates a UserProfile table by default which I'd like to split into two tables to accomodate the user information for both the roles respectively.

Please suggest if and how this can be achieved.

Thanks.

1

There are 1 best solutions below

4
Jawand Singh On

You have Roles defined in your 'Roles' Table. Then, for a particular User, UserId and RoleId both are associated with each other in another Table named '_UserInRoles'. Now, Create another table maybe Named as 'UserAdditionalInfo' and make table structure as below

Id(PK)
UserId(FK)
RoleId(FK)
Column1
Column2

Now, you can save user additional data according to its RoleId and UserId in another table and when you need to display User Profile on front end, then may be you can use JOIN in these tables and return information.