Last post May 17, 2013 11:31 PM by litu5277
May 16, 2013 10:48 PM|litu5277|LINK
I am familiar with adding security to a website using SImpleMembership as detailed here: http://www.asp.net/web-pages/tutorials/security/16-adding-security-and-membership .
However, I have a scenario where I have multiple types of profiles e.g. teacher profile and student profile. Each profile has different fields.
So I am not sure how to get this to work with SimpleMembership. From what I can tell, you can only use one user profile table? What would be the best approach to apply to my scenario. The only thing I can think of is having all the fields for both teacher
and student profiles in one UserProfile table. But that does sound optimal to me. Is it possible to have say, StudentProfile and TeacherProfile tables using SimpleMembership. How would I go about initializing that in the appstart file?
Any suggestions would be greatly appreciated.
Thanks in advance
May 17, 2013 05:38 AM|wavemaster|LINK
What you could do is have the UserProfile table contain all the common information amongst users of your application, then have one or two other tables with the profile type specific information.
UserId would be your primary key, then you could have a table Teachers PK TeacherId witth foreign key UserId and a table Students PK StudentId and a foreign key UserId.
What is best? One or two tables?
What is the cost of having two seperate tables? More complexity, more difficult to maintain, more coding.
I myself do have a table where depending on the case, certain fields get filled.
No complaints so far.
May 17, 2013 11:31 PM|litu5277|LINK
Thanks Wavemaster. suspected that having everything in one table was not optimal. But looks like the route I may have to follow