title: An exception occurred while iterating over the results of a query for context type. The connection is closed
body: <p>I'm getting the following error during a LINQ query running</p>
  <blockquote>
  <p>An exception occurred while iterating over the results of a query for context type. The connection is closed</p>
  </blockquote>
  <p>It's curious that this happens only when app is published on Azure (Db is also in Azure) locally everything works like a charm</p>
  <p>The following block of code generates the error</p>
  <pre><code>List&lt;StoreProductCatalogPrice&gt; pricesToUpdate = await _storeProductCatalogPriceRepository.GetCurrentByProductCatalogId(productCatalogToUpdate);`
  </code></pre>
  <p><strong>Note</strong>: <code>productCatalogToUpdate</code> is a large <code>List&lt;Guid&gt;</code> with around 7k Guids</p>
  <p>Repository implementation:</p>
  <pre><code>public async Task&lt;List&lt;StoreProductCatalogPrice&gt;&gt; GetCurrentByProductCatalogId(List&lt;Guid&gt; productCatalogsIds)
  {          
      return await DbSet.Where(x =&gt; productCatalogsIds.Contains(x.StoreProductCatalogId)).ToListAsync();
  }
  </code></pre>
  <p><strong>Note 2</strong>: everything related to context is handled by native DI, via <code>AddDbContext&lt;T&gt;()</code></p>
  <p>Any idea why this happens?</p>