EntityConnection EntityConnection EntityConnection Constructors

Definition

Overloads

EntityConnection() EntityConnection()

Initializes a new instance of the EntityConnection class.

EntityConnection(String) EntityConnection(String) EntityConnection(String)

Initializes a new instance of the EntityConnection class, based on the connection string.

EntityConnection(MetadataWorkspace, DbConnection) EntityConnection(MetadataWorkspace, DbConnection) EntityConnection(MetadataWorkspace, DbConnection)

Initializes a new instance of the EntityConnection class with a specified MetadataWorkspace and DbConnection.

EntityConnection(MetadataWorkspace, DbConnection, Boolean) EntityConnection(MetadataWorkspace, DbConnection, Boolean) EntityConnection(MetadataWorkspace, DbConnection, Boolean)

Constructs the EntityConnection from Metadata loaded in memory

EntityConnection() EntityConnection()

Initializes a new instance of the EntityConnection class.

[System.Diagnostics.CodeAnalysis.SuppressMessage("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 ();
Public Sub New ()

EntityConnection(String) EntityConnection(String) EntityConnection(String)

Initializes a new instance of the EntityConnection class, based on the connection string.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("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 (string connectionString);
new System.Data.Entity.Core.EntityClient.EntityConnection : string -> System.Data.Entity.Core.EntityClient.EntityConnection
Public Sub New (connectionString As String)

Parameters

connectionString
String String String

The provider-specific connection string.

Exceptions

An invalid connection string keyword has been provided, or a required connection string keyword has not been provided.

EntityConnection(MetadataWorkspace, DbConnection) EntityConnection(MetadataWorkspace, DbConnection) EntityConnection(MetadataWorkspace, DbConnection)

Initializes a new instance of the EntityConnection class with a specified MetadataWorkspace and DbConnection.

[System.Diagnostics.CodeAnalysis.SuppressMessage("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 (System.Data.Entity.Core.Metadata.Edm.MetadataWorkspace workspace, System.Data.Common.DbConnection connection);
new System.Data.Entity.Core.EntityClient.EntityConnection : System.Data.Entity.Core.Metadata.Edm.MetadataWorkspace * System.Data.Common.DbConnection -> System.Data.Entity.Core.EntityClient.EntityConnection
Public Sub New (workspace As MetadataWorkspace, connection As DbConnection)

Parameters

connection
DbConnection DbConnection DbConnection

The underlying data source connection for this EntityConnection object.

Exceptions

The conceptual model is missing from the workspace.-or-The mapping file is missing from the workspace.-or-The storage model is missing from the workspace.-or-The connection is not in a closed state.

The connection is not from an ADO.NET Entity Framework-compatible provider.

EntityConnection(MetadataWorkspace, DbConnection, Boolean) EntityConnection(MetadataWorkspace, DbConnection, Boolean) EntityConnection(MetadataWorkspace, DbConnection, Boolean)

Constructs the EntityConnection from Metadata loaded in memory

[System.Diagnostics.CodeAnalysis.SuppressMessage("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 (System.Data.Entity.Core.Metadata.Edm.MetadataWorkspace workspace, System.Data.Common.DbConnection connection, bool entityConnectionOwnsStoreConnection);
new System.Data.Entity.Core.EntityClient.EntityConnection : System.Data.Entity.Core.Metadata.Edm.MetadataWorkspace * System.Data.Common.DbConnection * bool -> System.Data.Entity.Core.EntityClient.EntityConnection
Public Sub New (workspace As MetadataWorkspace, connection As DbConnection, entityConnectionOwnsStoreConnection As Boolean)

Parameters

workspace
MetadataWorkspace MetadataWorkspace MetadataWorkspace

Workspace containing metadata information.

connection
DbConnection DbConnection DbConnection

Store connection.

entityConnectionOwnsStoreConnection
Boolean Boolean Boolean

If set to true the store connection is disposed when the entity connection is disposed, otherwise the caller must dispose the store connection.

Applies to