Static method EntityFramework!Database.Exists(DbConnection) returns true when ObjectContext.DatabaseExists() for a context created with the same database connection returns false (direct mode, a user with an empty schema exists in the database). Tried it with all different values of DatabaseScript.Schema.DeleteDatabaseBehaviour with the same result.
In fact, Database.Exists() calls ObjectContext.DatabaseExists() internally for a specially constructed "empty" context:
Code: Select all
DbModelBuilder().Build(connection).Compile().CreateObjectContext<ObjectContext>(connection)
As no StoreItemCollection is supplied in this case, the only viable option would be to determine if user's schema contains at least one database object (which probably corresponds to DeleteDatabaseBehaviour.AllSchemaObjects or DeleteDatabaseBehaviour.Schema).
Similar issue:
http://forums.devart.com/viewtopic.php?f=1&t=29260