views:

56

answers:

2

I'm using ASP.NET MVC.

I'm also using the MySQL connector and providers to connect to a MySQL database, which is using the ASP.NET Membership schema.

I also have a second table called 'user' which contains all the additional user data, company_id etc.

As I am going to need the (complete) User object for every page, what is the best way to access and persist the complete User object?

Should I be thinking about the User object with my extra data and the Membership User as different things, or is there a decent way to merge the two into one 'User' entity and access this on each page?

Thanks

A: 

Membership user and your User are two different things. But Membership user can persist ID of your User so you can bind these two together. Or you can store Membership ID as the key for your Users.

twk
A: 

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

I hope this will help

mberube.Net