I use this step for generating CodeFirst Classes in my MVC project:
1) run my app with membership support and call MVC Action that use membership to create membership default tables (Membership,User,UserInRoles,...)
2) add new .edmx file to my project and Choose "Generate from database" in wizard
3) Edit DB in .edmx file in Visual Studio (add new table)
4) create new database with "Generate Database from model" in .edmx
5) use Entity Framework Power Tools Beta 3 with "Reverse Engineer Code First"
6) delete existing Database and call MVC action that use my context
Is there a simpler way for this scenario?
I get this error:
Introducing FOREIGN KEY constraint 'FK_dbo.UsersInRoles_dbo.Users_Users_UserId' on table 'UsersInRoles' may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY constraints. Could not create constraint. See previous errors.
please guide me about error and any simple and rapid way for this.
Thanks.