Search code examples
entity-frameworksimplemembership

How get SimpleMembership in MVC4 project to create custom UserProfile fields for existing database?


I want to have SimpleMembership provider create necessary tables, including a custom UserProfile table, in my existing database. Problem is that the SimpleMembershipInitializer slips the CreateDatabase method or an existing database, and the WebSecurity.InitializeDatabaseConnection method only creates the standard UserProfile without my custom fields.

So is there any way to get the SimpleMembershipInitializer class to just add my enhanced UserProfile table to the existing database before WebSecurity.InitializeDatabaseConnection is called to create the other tables needed by the SimpleMembership provider? The existing database is used as model first, not code first.


Solution

  • Here you will find a tutorial which may help you, http://blog.spontaneouspublicity.com/including-asp-net-simple-membership-tables-as-part-of-your-entity-framework-model

    are you using code first?