DbProviderServices.DbDatabaseExists 方法

定义

重载

DbDatabaseExists(DbConnection, Nullable<Int32>, StoreItemCollection)

返回一个值,该值指示服务器上是否存在给定的数据库。

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

返回一个值,该值指示服务器上是否存在给定的数据库。

DbDatabaseExists(DbConnection, Nullable<Int32>, StoreItemCollection)

返回一个值,该值指示服务器上是否存在给定的数据库。

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

参数

connection
DbConnection

通过此方法检查其是否存在的数据库的连接。

commandTimeout
Nullable<Int32>

确定数据库是否存在所需的任何命令的执行超时。

storeItemCollection
StoreItemCollection

模型中所有存储项的集合。 此参数不再用于确定数据库是否存在。

返回

如果提供程序仅基于连接就可推导数据库,则为 true。

适用于

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

返回一个值,该值指示服务器上是否存在给定的数据库。

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

参数

connection
DbConnection

通过此方法检查其是否存在的数据库的连接。

commandTimeout
Nullable<Int32>

确定数据库是否存在所需的任何命令的执行超时。

storeItemCollection
Lazy<StoreItemCollection>

模型中所有存储项的集合。 此参数不再用于确定数据库是否存在。

返回

如果提供程序仅基于连接就可推导数据库,则为 true。

注解

重写此方法以避免创建不需要的存储项集合。 默认实现计算 Lazy 并调用此方法的另一个重载。

适用于