title: ASP.NET MVC - Using UnitOfWork
body: <p>I'm currently working on a web app which consist of 6 layers:</p>
  
  <ul>
  <li>Web (reference to ViewModels and Controllers)</li>
  <li>ViewModels</li>
  <li>Controllers </li>
  <li>Services (reference to Data and Entities)</li>
  <li>Data (reference to Entities)</li>
  <li>Entities</li>
  </ul>
  
  <p>What I'm trying to is to implement a "UnitOfWork" pattern, and therefore I have a class thats injected by DI for that job which makes it possible to do .commit() in the actionresult in the controller when I'm done with the database.</p>
  
  <p>Now is my question... Where should this UnitOfWork class be placed? It's at the moment in my Data layer but that requires the Controller layer to reference the Data layer AND the Service layer, which is odd in my opinion... Should I move the UnitOfWork class/interface to the Service layer and use DI?</p>