EntityConnection, constructeur (MetadataWorkspace, DbConnection, Boolean)
[Cette page concerne Entity Framework version 6. La dernière version est disponible sous le nom de package 'Entity Framework' NuGet. Pour plus d'informations sur Entity Framework, consultez msdn.com/data/ef.]
Construit l'objet EntityConnection à partir des métadonnées chargées en mémoire
Espace de noms : System.Data.Entity.Core.EntityClient
Assembly : EntityFramework (dans EntityFramework.dll)
Syntaxe
'Déclaration
<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 _
)
'Utilisation
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
)
Paramètres
- workspace
Type : System.Data.Entity.Core.Metadata.Edm.MetadataWorkspace
Espace de travail contenant des informations de métadonnées
- connection
Type : System.Data.Common.DbConnection
Connexion du magasin.
- entityConnectionOwnsStoreConnection
Type : System.Boolean
Si défini sur true, la connexion du magasin est supprimée en même temps que la connexion d'entité, sinon, l'appelant doit supprimer la connexion du magasin.