Share via


Metodo ObjectContext.DatabaseExists

[Questa pagina è specifica della versione 6 di Entity Framework. La versione più recente è disponibile come pacchetto NuGet per "Entity Framework". Per ulteriori informazioni su Entity Framework, vedere la pagina msdn.com/data/ef.]

Controlla se il database specificato come database nella connessione all'archivio corrente esiste nell'archivio. La maggior parte del lavoro viene eseguito tramite l'implementazione di DbProviderServices per la connessione all'archivio corrente.

Spazio dei nomi:  System.Data.Entity.Core.Objects
Assembly:  EntityFramework (in EntityFramework.dll)

Sintassi

'Dichiarazione
<SuppressMessageAttribute("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")> _
Public Overridable Function DatabaseExists As Boolean
'Utilizzo
Dim instance As ObjectContext 
Dim returnValue As Boolean 

returnValue = instance.DatabaseExists()
[SuppressMessageAttribute("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
public virtual bool DatabaseExists()
[SuppressMessageAttribute(L"Microsoft.Design", L"CA1031:DoNotCatchGeneralExceptionTypes")]
public:
virtual bool DatabaseExists()
[<SuppressMessageAttribute("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")>]
abstract DatabaseExists : unit -> bool 
[<SuppressMessageAttribute("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")>]
override DatabaseExists : unit -> bool
public function DatabaseExists() : boolean

Valore restituito

Tipo: System.Boolean
true se il database esiste; in caso contrario, false.

Vedere anche

Riferimento

ObjectContext Classe

Spazio dei nomi System.Data.Entity.Core.Objects