开发者

Closing an EDM ObjectContext?

开发者 https://www.devze.com 2022-12-23 19:03 出处:网络
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

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?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号