DbProviderServices.DbDatabaseExists Method

Definition

Overloads

DbDatabaseExists(DbConnection, Nullable<Int32>, StoreItemCollection)

Returns a value indicating whether a given database exists on the server.

DbDatabaseExists(DbConnection, Nullable<Int32>, Lazy<StoreItemCollection>)

Returns a value indicating whether a given database exists on the server.

DbDatabaseExists(DbConnection, Nullable<Int32>, StoreItemCollection)

Returns a value indicating whether a given database exists on the server.

protected virtual bool DbDatabaseExists (System.Data.Common.DbConnection connection, Nullable<int> commandTimeout, System.Data.Entity.Core.Metadata.Edm.StoreItemCollection storeItemCollection);
abstract member DbDatabaseExists : System.Data.Common.DbConnection * Nullable<int> * System.Data.Entity.Core.Metadata.Edm.StoreItemCollection -> bool
override this.DbDatabaseExists : System.Data.Common.DbConnection * Nullable<int> * System.Data.Entity.Core.Metadata.Edm.StoreItemCollection -> bool

Parameters

connection
DbConnection

Connection to a database whose existence is checked by this method.

commandTimeout
Nullable<Int32>

Execution timeout for any commands needed to determine the existence of the database.

storeItemCollection
StoreItemCollection

The collection of all store items from the model. This parameter is no longer used for determining database existence.

Returns

True if the provider can deduce the database only based on the connection.

Applies to

DbDatabaseExists(DbConnection, Nullable<Int32>, Lazy<StoreItemCollection>)

Returns a value indicating whether a given database exists on the server.

protected virtual bool DbDatabaseExists (System.Data.Common.DbConnection connection, Nullable<int> commandTimeout, Lazy<System.Data.Entity.Core.Metadata.Edm.StoreItemCollection> storeItemCollection);
abstract member DbDatabaseExists : System.Data.Common.DbConnection * Nullable<int> * Lazy<System.Data.Entity.Core.Metadata.Edm.StoreItemCollection> -> bool
override this.DbDatabaseExists : System.Data.Common.DbConnection * Nullable<int> * Lazy<System.Data.Entity.Core.Metadata.Edm.StoreItemCollection> -> bool
Protected Overridable Function DbDatabaseExists (connection As DbConnection, commandTimeout As Nullable(Of Integer), storeItemCollection As Lazy(Of StoreItemCollection)) As Boolean

Parameters

connection
DbConnection

Connection to a database whose existence is checked by this method.

commandTimeout
Nullable<Int32>

Execution timeout for any commands needed to determine the existence of the database.

storeItemCollection
Lazy<StoreItemCollection>

The collection of all store items from the model. This parameter is no longer used for determining database existence.

Returns

True if the provider can deduce the database only based on the connection.

Remarks

Override this method to avoid creating the store item collection if it is not needed. The default implementation evaluates the Lazy and calls the other overload of this method.

Applies to