DbContext Constructor (DbConnection, Boolean)

Constructs a new context instance using the existing connection to connect to a database. The connection will not be disposed when the context is disposed.

Namespace:  System.Data.Entity
Assembly:  EntityFramework (in EntityFramework.dll)

public function DbContext(
	existingConnection : DbConnection, 
	contextOwnsConnection : boolean
)

Parameters

existingConnection
Type: System.Data.Common.DbConnection

An existing connection to use for the new context.

contextOwnsConnection
Type: System.Boolean

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

Show: