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.

Exception Condition
ArgumentNullException

The connection is null.

ArgumentException

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

.NET Framework
Available since 3.5
Return to top
Show: