ObjectContext Constructor (EntityConnection^, String^)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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: