ObjectContext Constructor (EntityConnection^, String^)
.NET Framework (current version)
Initializes a new instance of the ObjectContext class with a given connection and entity container name.
Assembly: System.Data.Entity (in System.Data.Entity.dll)
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
Available since 3.5
Show: