Share via


RelationalConnection.DbConnection Property

Definition

Gets or sets the underlying DbConnection used to connect to the database.

public virtual System.Data.Common.DbConnection DbConnection { get; }
public virtual System.Data.Common.DbConnection DbConnection { get; set; }
member this.DbConnection : System.Data.Common.DbConnection
member this.DbConnection : System.Data.Common.DbConnection with get, set
Public Overridable ReadOnly Property DbConnection As DbConnection
Public Overridable Property DbConnection As DbConnection

Property Value

Implements

Remarks

The connection can only be changed when the existing connection, if any, is not open.

Note that a connection set must be disposed by application code since it was not created by Entity Framework.

Applies to