title: How to build a Predicate or Criteria builder for your DAL that understands lambdas?
body: <p>I am working on a Data Access Layer Design, we have not finalized what ORM we are going to use as of yet.
  I am leaning towards NHibernate + FluentMappings + Nhibernate.Linq but depending on project timelines we could even wait for EF4. I want to replace methods like :</p>
  
  <pre><code>IList&lt;Customer&gt; FindById(int id);
  
  IList&lt;Customer&gt; FindByName(string fullName);
  </code></pre>
  
  <p>to </p>
  
  <pre><code>IList&lt;Customer&gt; FindByCriteria(Func&lt;Customer, bool&gt; criteria);
  </code></pre>
  
  <p>or even</p>
  
  <pre><code>IList&lt;T&gt; FindByCriteria(Func&lt;T, bool&gt; criteria)
  </code></pre>
  
  <p>so the idea is to chain or build a criteria based on the requirement (from UI or Business ) dynamically to a repository or DAO object. Any code samples, links , blog posts , hints are welcome.</p>
  
  <p>Thanks in advance!</p>