For EF6, I can check whether a database exists in the following way:
context.Database.Exists()
How can I do this in EF Core?
I have found the solution on my own:
(context.GetService<IDatabaseCreator>() as RelationalDatabaseCreator).Exists()
It works for EF 7.0.0-rc1-final version for SqlServer
UPDATE:
Entity Framework Core 2.0:
(context.Database.GetService<IDatabaseCreator>() as RelationalDatabaseCreator).Exists()
UPDATE .Net Core 3.1
To check if a database exists and can be contacted:
dbContext.Database.CanConnect()