Export (0) Print
Expand All

DbContext Constructor (DbConnection, Boolean)

Entity Framework 5.0

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)

new : 
        existingConnection:DbConnection * 
        contextOwnsConnection:bool -> DbContext


Type: System.Data.Common.DbConnection

An existing connection to use for the new context.

Type: System.Boolean

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

© 2014 Microsoft