Reputation: 526
I'm creating a login mechanism for multiple types of users. My primary users are companies and students at the moment. Students have specific permissions such as editing their employment history, education, etc. Companies also have specific information such as their company name, website url, primary contact information, etc. I know I can separate a specific user via roles, but how do I separate the information that pertains to each type of user in a clean way. I know I can jam all the columns into the users table, but I don't like that approach. I will be creating a role for each type of user, but I still wanted an organized way to store user specific information based on the type of user they are. I also want the approach to be flexible for maintainability because I expect to add more user types in the future. I am using Entity Framework with SQL Server.
Upvotes: 0
Views: 66
Reputation: 67175
I would create tables for each type of user, and give those tables any columns that are not in your common users table.
Then simply have each of your specialized tables link to the common table.
This allows the common table to work normally as intended by ASP.NET, and for you to also have your specialized columns in the joined tables.
Upvotes: 2