Search code examples
c#asp.netauthenticationidentitymembership-provider

Login and register using Asp.net Identity C# MVC Need to add our own table too


I am using ASP.NET Identity for login mechanism. In register Page I have to store some more details from another model also.

My Question is, can I add details in my own table with system provided membership table(s) in same time?

Please guide me for the above thank you..


Solution

  • There is a RegisterViewModel (which isn't mapped to a database table) that you could extend with all the properties you need. It's located in Models/AccountViewModels.cs. Then in your AccountController, in the Register method, after the line that says if (result.Succeeded) you can add in your own code to put the extra data into the other 3 tables.