In my ASP.net MVC5 project it creates the default database by Visual Studio 2013.
I went to the App_Data folder and deleted the mdf file from the database as well as the log file.
I'm wanting it to re-create this file.
In my configuration file, I have the following code.
public class UserDBContext: DbContext
{
public UserDBContext(): base("ConnectionString")
{
Database.SetInitializer<UserDBContext>(new CreateDatabaseIfNotExists<UserDBContext>());
}
public DbSet<Cliente> Clientes{ get; set; }
public DbSet<Topico> Topicos{ get; set; }
}
It passes, and does not give any error, however it does not create the database file.