title: Using Entity Framework with Castle Windsor
body: <p>I use the Entity Framework database-first approach to generate a DbContext / POCO model for an MVC application. I want to avoid having dependencies on DbContext in my controllers to enable me to switch to another persistence provider as I need to (for example for unit testing purposes). </p>
  
  <p>To do this I want to use the Castle Windsor IoC container. I plan to register DbContext as an IUnitOfWork service and to register a generic IRepository service, implementations of which I will use to access and work with aggregate roots in the model.</p>
  
  <p>I'm new to Windsor and haven't been able to find much info about using it with EF, and I have a couple of questions:</p>
  
  <ul>
  <li>is this a reasonable approach if I want to decouple EF from the application?</li>
  <li>how do I install / register the IUnitOfWork and generic IRepository services?</li>
  </ul>