Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
ObjectContext Constructor (EntityConnection, String)

ObjectContext Constructor (EntityConnection, String)

Initializes a new instance of the ObjectContext class with a given connection and entity container name.

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

protected ObjectContext(
	EntityConnection connection,
	string defaultContainerName
)

Parameters

connection
Type: System.Data.EntityClient.EntityConnection

An EntityConnection that contains references to the model and to the data source connection.

defaultContainerName
Type: System.String

The name of the default entity container. When the defaultContainerName is set through this method, the property becomes read-only.

ExceptionCondition
ArgumentNullException

The connection is null.

ArgumentException

The connection, defaultContainerName, or metadata workspace is not valid.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5 SP1

.NET Framework Client Profile

Supported in: 4
Show:
© 2015 Microsoft