DbProviderServices.DbDatabaseExists 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
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
通过此方法检查其是否存在的数据库的连接。
- 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
通过此方法检查其是否存在的数据库的连接。
- storeItemCollection
- Lazy<StoreItemCollection>
模型中所有存储项的集合。 此参数不再用于确定数据库是否存在。
返回
如果提供程序仅基于连接就可推导数据库,则为 true。
注解
重写此方法以避免创建不需要的存储项集合。 默认实现计算 Lazy 并调用此方法的另一个重载。