开发者

Closing an EDM ObjectContext?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜