DataContext.Connection Property

Definition

Gets the connection used by the framework.

C#
public System.Data.Common.DbConnection Connection { get; }

Property Value

The connection used by the framework.

Remarks

You can use this property to interoperate with relational ADO.NET code.

The returned connection will be closed unless it has been explicitly opened by the user.

Applies to

Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1