title: Best way to handle the DataContext in LINQ to SQL
body: <p>I've gotten the go-ahead at work to implement LINQ to SQL for a new module in our ASP.NET app.  I forget the best way to handle the DataContext required to retrieve objects; should I create it in every method that makes use of it, or have some kind of Utility class to manage it in a different fashion?  </p>
  
  <p>For instance, I have a class that  ActiveRecord-style retrieves an entity. Should I be using something like:</p>
  
  <pre><code>using (MyAppDataContext context = new MyAppDataContext()) 
  {
      // do stuff here...
  }
  </code></pre>
  
  <p>in each of these methods?  I've seen this used frequently in the LINQ tutorials but I've also seen a way where there is a <code>Utilities</code> class that has some method that returns the DataContext (<code>GetContext</code> or similar); I forget if the method was just a wrapper around newing one up or if it did some kind of Singleton-type mechanism.</p>
  
  <p>Which would be the better approach?</p>