title: Repository: Examples for a Decorator / Repository pattern in C#
body: <p>I had the wrong idea of how to create a repository.  I created a single repository for each Entity that would CRUD using an ORM, which worked very well.  However, I needed more and didn't know how to do it without messing up my existing code.</p>
  
  <p>I wanted to add filtering based on Logins.  I eventually found Castle.Windsor references showing something like this:</p>
  
  <pre><code>var ControllerContactRepo = new SecurityContactRepo( new ContactRepo() );
  </code></pre>
  
  <p>Where the Controller in MVC accesses one repository for Contacts which handles both CRUD and security without the controller knowing it.  I presume the POCOs passed between repositories change based on the Liskov substitution principle, and the repositories are done with the decorator design pattern?</p>
  
  <p><strong>Where can I see some C# examples of this technique before I jump head first in to Castle Windsor?</strong>  I am familiar with Constructor based IoC but not so much DI.  I really want to know the nuts and bolts of this technique before I abstract it away with Windsor.</p>
  
  <p>Links to website tutorials would be great, or book suggestions.</p>