I was studying this tutorial asp.net Movie Tutorial and I have 2 simple files in my model.
public class Movie
{
public int ID { get; set; }
[Requ
Entity Framework will only migrate one DbContext. Period. There's no way around this, currently. That means very plainly and simply that everything that EF will need to work with must be in this single context.
However, that doesn't preclude you from using other contexts elsewhere for different purposes. So in your MovieDBContext go ahead and add your UserProfile entity set:
public DbSet User { get; set; }
Then, in your other contexts, you just need to 1) make sure they interact with the same database and 2) that they don't have an initialization strategy, e.g.:
public class AccountsContext : DbContext
{
public AccountsContext()
: base("name=ConnectionStringNameHere")
{
Database.SetInitializer(null);
}
public DbSet User { get; set; }
...
}
That will make EF treat this context as a mapping to an existing database, so it won't try to create database tables, migrations, etc. All that will be done via your primary context (MovieDbContext in this case).