title: Use the option IsolationLevel.ReadUncommited for only one query in DbContext
body: <p>In a .NET Core Project I'm using EntityFramework and I have a DbContext (shopContext) injected in my class repository. I have the next query:</p>
  
  <pre><code>var res = shopContext.Orders.Where(x =&gt; x.Status == 1).Sum(p =&gt; p.Total);
  </code></pre>
  
  <p>Occasionally, the Orders table is doing maintenance tasks and the table is locked. For this query, I can't wait to the maintenance tasks and I need access to the table with the <code>IsolationLevel.ReadUncommited</code> option in the transaction:</p>
  
  <pre><code>using (var transaction = mutuaContext.Database.BeginTransaction(IsolationLevel.ReadUncommitted))
  {
      var res = shopContext.Orders.Where(x =&gt; x.Status == 1).Sum(p =&gt; p.Total);
  }
  </code></pre>
  
  <p>The problem is that I only want that the context execute the query with this IsolationLevel configuration in these query, but the next queries continue executing although the table is locked yet.</p>
  
  <p>Why are the following queries not waiting for the Table to be unlocked?</p>
  
  <p>Example of my code:</p>
  
  <pre><code>using (var transaction = mutuaContext.Database.BeginTransaction(IsolationLevel.ReadUncommitted))
  {
      var res = shopContext.Orders.Where(x =&gt; x.Status == 1).Sum(p =&gt; p.Total); // this code would be executed
  }
  
  var total = shopContext.Orders.Where(x =&gt; x.Status == 0).Sum(p =&gt; p.Total); // this code would NOT be executed but is executed
  </code></pre>
  
  <p>I don't understand how the context get the transaction configuration. I would like that someone explain it to me.</p>
  
  <p>I tried call to <code>transaction.Commit()</code> after fist query, but still not working.</p>