I want to dispose the devDB context object in the below code.
private static void InitContainer()
var devDB = new TestContext(constr);
private static void CleanUp()
if (Container != null)
I tried a using statement, but the I receive the following error:
The ObjectContext instance has been disposed and can no longer be used for operations that require a connection.
How can I dispose devDB correctly?