Condividi tramite


Metodo Database.CreateIfNotExists

[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.]

Crea un nuovo database nel server di database per il modello definito nel contesto di supporto, ma solo se un database con lo stesso nome non esiste già nel server.

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

Sintassi

'Dichiarazione
Public Function CreateIfNotExists As Boolean
'Utilizzo
Dim instance As Database 
Dim returnValue As Boolean 

returnValue = instance.CreateIfNotExists()
public bool CreateIfNotExists()
public:
bool CreateIfNotExists()
member CreateIfNotExists : unit -> bool
public function CreateIfNotExists() : boolean

Valore restituito

Tipo: System.Boolean
True se il database non esisteva ed è stato creato; in caso contrario, false.

Vedere anche

Riferimento

Database Classe

Spazio dei nomi System.Data.Entity