title: Parallel doesnt work with Entity Framework
body: <p>I have a list of IDs, and I need to run several stored procedures on each ID.</p>
  
  <p>When I am using a standard foreach loop, it works OK, but when I have many records, it works pretty slow.</p>
  
  <p>I wanted to convert the code to work with EF, but I am getting an exception: "The underlying provider failed on Open".</p>
  
  <p>I am using this code, inside the Parallel.ForEach:</p>
  
  <pre><code>using (XmlEntities osContext = new XmlEntities())
  {
      //The code
  }
  </code></pre>
  
  <p>But it still throws the exception.</p>
  
  <p>Any idea how can I use Parallel with EF? do I need to create a new context for every procedure I am running? I have around 10 procedures, so I think its very bad to create 10 contexts, one for each.</p>