How to: Use EntityConnection with an Object Context
The example in this topic is based on the AdventureWorks Sales Model. To run the code in this example, you must have already added the AdventureWorks Sales Model to your project and configured your project to use the Entity Framework. To do this, complete the procedure in How to: Use the Entity Data Model Wizard.
This example creates an EntityConnection that is passed into the constructor of a long-running ObjectContext. The connection is opened manually. Both the EntityConnection ObjectContext are disposed manually.