title: NOT using repository pattern, use the ORM as is (EF)
body: <p>I always used Repository pattern but for my latest project I wanted to see if I could perfect the use of it and my implementation of “Unit Of Work”. The more I started digging I started asking myself the question: <strong>"Do I really need it?"</strong></p>
  
  <p>Now this all starts with a couple of comments on Stackoverflow with a trace to Ayende Rahien's post on his blog, with 2 specific,</p>
  
  <ul>
  <li><a href="http://ayende.com/blog/3955/repository-is-the-new-singleton">repository-is-the-new-singleton</a></li>
  <li><a href="http://ayende.com/blog/153701/ask-ayende-life-without-repositories-are-they-worth-living">ask-ayende-life-without-repositories-are-they-worth-living</a></li>
  </ul>
  
  <p>This could probably be talked about forever and ever and it depends on different applications. Whats I like to know,</p>
  
  <ol>
  <li>would this approach be suited for a Entity Framework project?</li>
  <li>using this approach is the business logic still going in a service layer, or extension methods (as explained below, I know, the extension method is using NHib session)?</li>
  </ol>
  
  <p><strong>That's easily done using extension methods. Clean, simple and reusable.</strong></p>
  
  <pre><code>public static IEnumerable GetAll(
      this ISession instance, Expression&lt;Func&lt;T, bool&gt;&gt; where) where T : class
  {
      return instance.QueryOver().Where(where).List();
  }
  </code></pre>
  
  <p>Using this approach and <code>Ninject</code> as DI, do I need to make the <code>Context</code> a interface and inject that in my controllers?</p>