title: Where should the transaction boundary be in a repository pattern?
body: <p>I have a repository like so:</p>
  
  <pre><code>public interface IRepository
  {
      void Save&lt;T&gt;(T entity);
      void Create&lt;T&gt;(T entity);
      void Update&lt;T&gt;(T entity);
      void Delete&lt;T&gt;(T entity);
      IQueryable&lt;T&gt; GetAll&lt;T&gt;();
  }
  </code></pre>
  
  <p>My question is, where should my transaction boundaries be? Should I open a new transaction on every method and commit it before returning? Or should it be around the entire repository so that the transaction is only committed when the repository is disposed/garbage collected?</p>