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
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft