views:

14

answers:

1

I am getting started with the ADO.NET Entity Framework 4.0. I have created an EDM and data store for the app, and it successfully retrieves entities. The application holds the EDM's ObjectContext as a member-level variable, which it uses to call ObjectContext.SaveChanges(). So far, so good.

I am going to refactor to repositories later. Right now, my question is a bit more basic: When I am finished with the EDM, what do I need to do to release it? Is it as simple as calling Dispose() on the ObjectContext? Thanks for your help.

+1  A: 

Yes, calling dispose on the ObjectContext is sufficient to dispose of the resources.

Peter Oehlert
Wow--pretty cool that it is that simple.
David Veeneman