Condividi tramite


Costruttore EntityConnection (MetadataWorkspace, DbConnection, Boolean)

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

Costruisce l'elemento EntityConnection dai metadati caricati in memoria

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

Sintassi

'Dichiarazione
<SuppressMessageAttribute("Microsoft.Reliability", "CA2000:DisposeObjectsBeforeLosingScope", Justification := "Object is in fact passed to property of the class and gets Disposed properly in the Dispose() method.")> _
Public Sub New ( _
    workspace As MetadataWorkspace, _
    connection As DbConnection, _
    entityConnectionOwnsStoreConnection As Boolean _
)
'Utilizzo
Dim workspace As MetadataWorkspace 
Dim connection As DbConnection 
Dim entityConnectionOwnsStoreConnection As Boolean 

Dim instance As New EntityConnection(workspace, _
    connection, entityConnectionOwnsStoreConnection)
[SuppressMessageAttribute("Microsoft.Reliability", "CA2000:DisposeObjectsBeforeLosingScope", Justification = "Object is in fact passed to property of the class and gets Disposed properly in the Dispose() method.")]
public EntityConnection(
    MetadataWorkspace workspace,
    DbConnection connection,
    bool entityConnectionOwnsStoreConnection
)
[SuppressMessageAttribute(L"Microsoft.Reliability", L"CA2000:DisposeObjectsBeforeLosingScope", Justification = L"Object is in fact passed to property of the class and gets Disposed properly in the Dispose() method.")]
public:
EntityConnection(
    MetadataWorkspace^ workspace, 
    DbConnection^ connection, 
    bool entityConnectionOwnsStoreConnection
)
[<SuppressMessageAttribute("Microsoft.Reliability", "CA2000:DisposeObjectsBeforeLosingScope", Justification = "Object is in fact passed to property of the class and gets Disposed properly in the Dispose() method.")>]
new : 
        workspace:MetadataWorkspace * 
        connection:DbConnection * 
        entityConnectionOwnsStoreConnection:bool -> EntityConnection
public function EntityConnection(
    workspace : MetadataWorkspace, 
    connection : DbConnection, 
    entityConnectionOwnsStoreConnection : boolean
)

Parametri

  • entityConnectionOwnsStoreConnection
    Tipo: System.Boolean
    Se impostato su true, la connessione all'archivio viene eliminata quando viene eliminata la connessione entità. In caso contrario, il chiamante deve eliminare la connessione all'archivio.

Vedere anche

Riferimento

EntityConnection Classe

Overload EntityConnection

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