Answer the question
In order to leave comments, you need to log in
How to enable migration for 2 contexts?
Created an ASP.NET MVC 5 project with Individual User Accounts authentication. Classes were automatically created, a connection string for working with authentication. I added my connection string, my model, my context (example. Model - book. Context - Contex, in the context of DbSet book {get; set;}).
I'm trying to enable migrations (enable-migrations), it gives the error
More than one context type was found in the assembly 'MVC'.
To enable migrations for 'MVC.Models.Contex', use Enable-Migrations -ContextTypeName MVC.Models.Contex.
To enable migrations for 'MVC.Models.ApplicationDbContext', use Enable-Migrations -ContextTypeName MVC.Models.ApplicationDbContext.
That is, it offers to enable migration for only one context, but how to enable it for 2 contexts? All of a sudden I plan to change the user model, e.g.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question