title: Is using TransactionScope in Entity Framework queries a good idea?
body: <p>I've been reading a document from Microsoft's patterns &amp; practices group (<a href="https://msdn.microsoft.com/en-us/library/dn271399.aspx">Data Access for Highly-Scalable Solutions: Using SQL, NoSQL, and Polyglot Persistence</a>).</p>
  
  <p>In Chapter 3, in the section <a href="https://msdn.microsoft.com/en-us/library/dn313277.aspx#sec28">"Retrieving Data from the SQL Server Database"</a>, the authors discuss using Entity Framework to load entities from a database. Here's a bit of their sample code:</p>
  
  <pre><code>using (var context = new PersonContext())
  {
      Person person = null;
  
      using (var transactionScope = this.GetTransactionScope())
      {
          person = context.Persons
              .Include(p =&gt; p.Addresses)
              .Include(p =&gt; p.CreditCards)
              .Include(p =&gt; p.EmailAddresses)
              .Include(p =&gt; p.Password)
              .SingleOrDefault(p =&gt; p.BusinessEntityId == personId);
  
          transactionScope.Complete();
      }
  
      // etc...
  }
  </code></pre>
  
  <p>Note the use of a custom transaction scope via the <code>GetTransactionScope</code> method, implemented in their base context class like so:</p>
  
  <pre><code>public abstract class BaseRepository
  {
      private static TransactionOptions transactionOptions = new TransactionOptions()
      {
          IsolationLevel = IsolationLevel.ReadCommitted
      };
  
      protected virtual TransactionScope GetTransactionScope()
      {
          return new TransactionScope(TransactionScopeOption.Required, transactionOptions);
      }
  }
  </code></pre>
  
  <p><a href="https://msdn.microsoft.com/en-US/data/dn456843">Working with Transactions (EF6 Onwards)</a> on MSDN states:</p>
  
  <blockquote>
    <p>In all versions of Entity Framework, whenever you execute SaveChanges() to insert, update or delete on the database the framework will wrap that operation in a transaction [...] the isolation level of the transaction is whatever isolation level the database provider considers its default setting. By default, for instance, on SQL Server this is READ COMMITTED. <strong>Entity Framework does not wrap queries in a transaction.</strong> This default functionality is suitable for a lot of users</p>
  </blockquote>
  
  <p>The bold emphasis is mine.</p>
  
  <p>My question: is the use of a <strong>TransactionScope</strong> as shown above overkill, particularly for data reads, when using Entity Framework?</p>
  
  <p>(I realised after posting that the answer to this question might be somewhat opinion-based, sorry about that.)</p>