EntityConnection-Konstruktor (MetadataWorkspace, DbConnection, Boolean)
[Diese Seite bezieht sich auf Entity Framework Version 6. Die neueste Version ist als 'Entity Framework' NuGet-Paket verfügbar. Weitere Informationen zu Entity Framework finden Sie unter msdn.com/data/ef.]
Erstellt das EntityConnection-Objekt aus Metadaten, die in den Arbeitsspeicher geladen werden
Namespace: System.Data.Entity.Core.EntityClient
Assembly: EntityFramework (in EntityFramework.dll)
Syntax
'Declaration
<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 _
)
'Usage
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
)
Parameter
- workspace
Typ: System.Data.Entity.Core.Metadata.Edm.MetadataWorkspace
Arbeitsbereich, der Metadateninformationen enthält.
- connection
Typ: System.Data.Common.DbConnection
Speicher-Verbindung.
- entityConnectionOwnsStoreConnection
Typ: System.Boolean
Mit true wird die Verbindung verworfen, wenn die Entitätsverbindung verworfen wird, andernfalls muss der Aufrufer die Speicherverbindung verwerfen.