What is the best way to store additional user data than storing in the aspnet_users table

I am using ASP.NET MVC.

I am also using the MySQL connector and providers to connect to a MySQL database that uses the ASP.NET membership scheme.

I also have a second table named "user" which contains all additional user data, company_id, etc.

How would I need a (complete) User object for each page, what's the best way to access and store the complete User object?

Should I think of the User object with my extra data and the Membership User as different things, or is there a decent way to combine them into one "custom" object and access them on every page?

thank

+2


source to share


2 answers


Member User and your User are two different things. But the membership user can store your user ID so you can link the two together. Or, you can store the membership ID as a key for your users.



+1


source


You can also use the Profile object (which stores information in aspnet_Profile if the MySQL membership schema contains the same tables as ASPNETDB). By configuring your web.config correctly, you can dynamically add new properties to the profile and use it as instance properties (eg: Profile.Company).



I hope this helps

0


source







All Articles