Saturday, 14 September 2013

Different types of Users with simplemembership in ASP.NET EF code first

Different types of Users with simplemembership in ASP.NET EF code first

In my app I want to have two different types of users. This types differ
not only in role but also in attributes. I am using simpleMembership for
userManagement and I want to ask what's the best way or practise to create
data model for my situation in EF using code first. I was thinking about
creating two another tables UsersType1 and UsersType2 which will have one
to one relationship with table userProfiles so in the model I would have:
public class UserType1{
attr1
attr2
....
public int userProfileID {get; set;}
public virtual UserProfile userProfile {get; set;}
}
And same way for table UserType2.
I want to ask if this is a good way to go and if so, how should I modify
userProfiles table to be able to access UserType1 and UserType2 through
userprofile in code.
Thank you.

No comments:

Post a Comment