ObjectContext.DatabaseExists 方法

定义

检查指定为当前存储区连接中的数据库是否存在于存储区上。 大部分实际工作由 DbProviderServices 实现为当前存储区连接完成。

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
public virtual bool DatabaseExists();
abstract member DatabaseExists : unit -> bool
override this.DatabaseExists : unit -> bool
Public Overridable Function DatabaseExists () As Boolean

返回

如果数据库存在,则为 true;否则为 false。

属性

适用于