DbProviderServices.DbDatabaseExists Method
Assembly: EntityFramework (in EntityFramework.dll)
Name | Description | |
---|---|---|
![]() | 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. |
DbProviderServices.DbDatabaseExists Method (DbConnection, Nullable<Int32>, Lazy<StoreItemCollection>)
Returns a value indicating whether a given database exists on the server.
protected virtual bool DbDatabaseExists( DbConnection connection, Nullable<int> commandTimeout, Lazy<StoreItemCollection> storeItemCollection )
Parameters
- connection
-
Type:
System.Data.Common.DbConnection
Connection to a database whose existence is checked by this method.
- commandTimeout
-
Type:
System.Nullable<Int32>
Execution timeout for any commands needed to determine the existence of the database.
- storeItemCollection
-
Type:
System.Lazy<StoreItemCollection>
The collection of all store items from the model. This parameter is no longer used for determining database existence.
Return Value
Type: System.BooleanTrue if the provider can deduce the database only based on the connection.
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.
DbProviderServices.DbDatabaseExists Method (DbConnection, Nullable<Int32>, StoreItemCollection)
Returns a value indicating whether a given database exists on the server.
protected virtual bool DbDatabaseExists( DbConnection connection, Nullable<int> commandTimeout, StoreItemCollection storeItemCollection )
Parameters
- connection
-
Type:
System.Data.Common.DbConnection
Connection to a database whose existence is checked by this method.
- commandTimeout
-
Type:
System.Nullable<Int32>
Execution timeout for any commands needed to determine the existence of the database.
- storeItemCollection
-
Type:
System.Data.Entity.Core.Metadata.Edm.StoreItemCollection
The collection of all store items from the model. This parameter is no longer used for determining database existence.
Return Value
Type: System.BooleanTrue if the provider can deduce the database only based on the connection.