Postgres data does not exist error
Posted: Sun 01 Jul 2018 21:58
We are using postgres dotconnect on Ef Core 2.1 with the pseudo code below to create a database. We get the error the database "Boo" does not exist. What do we need to do to get this working?
Code: Select all
var connectionString = "User Id=postgres;Password=Foo;Host=MyMachine;Database=Boo;License Key=""";
try
{
using ( var context = new MyContext ( connectionString ) )
{
context.Database.EnsureCreated ();
context.SaveChanges ();
}
}
catch ( Exception ex )
{
LogProvider.Logger.LogException ( "Failed to create empty database", ex );
throw ex;
}