I have specified the proper connection string in the web.config, but the database isn't creating nor it hits break point at seed method.
Code:
public class MusicStoreEntities:DbContext
{
public DbSet<Genre> genres;
public MusicStoreEntities()
: base("name=MusicStoreConnection")
{
Database.SetInitializer(new Myinitialzer());
}
}
public class Myinitialzer :CreateDatabaseIfNotExists<MusicStoreEntities>
{
protected override void Seed(MusicStoreEntities context)
{
var genres = new List<Genre>
{
new Genre { Name = "Rock" },
new Genre { Name = "Jazz" },
new Genre { Name = "Metal" },
};
}
}
Connection string:
<add name="MusicStoreConnection" providerName="System.Data.SqlClient" connectionString="Data Source=WAQAR_DEV;Initial Catalog=PlanetWrox;Integrated Security=true;" />