Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • 2
    I wonder if this answer is applicable for new DbContext class? msdn.microsoft.com/en-us/library/… Commented Dec 24, 2011 at 10:21
  • 2
    @tugberk: No idea, I'm afraid. I wouldn't assume it is. Commented Dec 24, 2011 at 10:24
  • 1
    Given the quoted text I actually arrive at the conclusion that you should always dispose the context as soon as you're done with it, not that it "doesn't matter too much". Because given the choice of: A) wondering if a coder stumbled into either of those 2 expensive gotcha conditions described by Matt Warren, or B) just having a blanket rule to call dispose on IDisposables when done. I find B makes things easier, especially with large teams Commented Nov 19, 2017 at 3:40