I'm using 7.6.763.0 of dcpostgresql76pro.
DbContext.Database.EnsureCreated() throw an "Database 'test' does not exist." exception instead of creating the database.
Code: Select all
class Program
{
static void Main(string[] args)
{
var context = new MyDbContext();
context.Database.EnsureCreated();
}
}
public class MyDbContext : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UsePostgreSql(@"Host=localhost;User Id=postgres;Password=postgres;Database=test;Unicode=true;");
}
}