I am using code first migrations to create and update the database for my asp mvc site.
I have a DbContext, which is in another project in the solution.
public class EFDbContext : DbContext
{
public DbSet<Book> Books { get; set; }
public DbSet<Author> Authors { get; set; }
public DbSet<Publisher> Publishers { get; set; }
}
When i enable-migrations and add-migration [name]. It seems to create its own db called
[foo-projectname].Domain.Concrete.EFDbContext
Instead of the attaching to the database i created, called [foo-projectname]. In the webconfig for the site the connection string is referencing by catalog "[foo-projectname]".
If i change the webconfig to the other database , then i get results back from items i have added into the that database. However i want to use the database that i created.
The reason i do not want to stick with this auto created one is because i am not sure on the migration to SqlServer and do not want to get stuck further down the line. I am also getting the error
The model backing the 'EFDbContext' context has changed since...
even when i have not changed anything.