Add SqlMembership tables using EF Code First
I'm wondering if it's possible to generate the standard MS SQL Server Membership tables (like you would using asp_reg tool) using EF Code First? If so, could you give me the steps necessary to do this?
If not, is my only option to add the tables using asp_reg or the membership sc开发者_StackOverflowripts to the database created by EF Code First? The problem then would be if I wanted to configure the site to drop and recreate the database on Application_Start, I would lose my membership tables...
You could use the EF Power Tools to reverse engineer the asp_reg tables into POCOs
(source: msdn.com)
You can have your own table for user, role, and userroles by creating custom membership provider. Have a look at How do I create a custom membership provider for ASP.NET MVC 2?
精彩评论