Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hello, i am trying to enable migrations for my scheduling application. I am new to this and i keep getting this message when i type enable migrations in the console

More than one context type was found in the assembly 'ScheduleWeb'.

To enable migrations for 'ScheduleWeb.Models.ApplicationDbContext', use Enable-Migrations -ContextTypeName ScheduleWeb.Models.ApplicationDbContext.

To enable migrations for 'ScheduleWeb.Models.ScheduleDbContext', use Enable-Migrations -ContextTypeName ScheduleWeb.Models.ScheduleDbContext.

Creating two migrations will create two databases. But i want my userdata along side my application data. how can i achieve this
Posted

1 solution

Your classes should be DBSets in the one context. It appears that you have split them into 2 contexts.
 
Share this answer
 
Comments
Sanjeev Prasad Poudel 18-Mar-14 3:20am    
I did not split them into two. The IdentityAccount model inherits from the ApplicationDbContext by default. I added the context class for other models in my application inheriting it from the DbContext class. How can I keep the two contexts in the same context
Nick Ginis 27-Mar-14 1:37am    
Add the other models to the ApplicationDBContext rather than creating a new Context class.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900