Is it possible to have automatic migration for one DbContext and not for another in the same project?

I would like to have two DbContexts in one project, but automatic migrations are allowed for only one. Is it possible?

0
source share
1 answer

It. Each is DbMigrationsConfigurationtied to one specific DbContextthrough ContextKey. Once you have more than that DbContext, the command Enable-Migrationsneeds a parameter -ContextTypeName. You can simply run Enable-MigrationsDbContext for one and omit it for another.

0
source

All Articles