Reputation: 1638
I have this table called Demographics that is related to the aspnet_Users table by the userId field. This Demographics table has about 20 fields that must inserted at the point that the user registers for the site.
I'm able to capture the aspnet_Users.UserId
of the just registered user in the Register(RegisterModel model)
controller action, but how do I go about setting the properties in the Demographics class (EF autogenerated this Model class and it's in a separate project) for this user? All the values for the Demographics class should come from the registration page created by Microsoft.
aspnet_Users(UserId, etc....)
Demographics(UserId, FirstName, LastName, Address, AgeRange, etc...)
Upvotes: 0
Views: 119
Reputation: 5573
You will have to create a View Model that incorporates necessary information for the UserMembership
and the Demographics
. Then you can just have your Create
controller for the User call the Register(RegisterModel model)
and also call the Register(Demographics demo)
Upvotes: 1