In my ASP.NET MVC3 application, I am having users, roles and entities. User Roles will be having access to entities. So while storing users and roles in database which of following is good approach?
-
To store user list in the entity tables
-
Entity Ids in the user table.
In future the number of entities may increase to 1000,10000 so I want to consider the performance aspect also.
I think the relationship between Role and Entity is many- to many. One role can have zero or more entities and one Entity may belongs to zero or more Role. So create a third table to store those with 2 columns,
RoleIdandEntityIDSample data would look like