A
A
amf1k2015-08-19 17:35:18
ASP.NET
amf1k, 2015-08-19 17:35:18

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

1 answer(s)
Y
Yuri, 2015-08-19
@Gilga

For Contex.
Do the same for ApplicationDbContext by replacing Contex and ContexMigrations.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question