title: Is it possible to create ICriteria/ICriterion from LINQ or HQL?
body: <p>I am creating a method that can create filter understood by NHibernate (by filter i mean a set of ICriteria object for example) from my abstract filter object.</p>
  
  <pre><code>public static IEnumerable&lt;ICriterion&gt; ToNhCriteria(this MyCriteria criteria)
  {
     // T4 generated function
     // lots of result.Add(Expression.Or(Expression.Eq(),Expression.Eq)) expression trees - hard to generate
     // Is there a way to generate HQL/Linq query here istead?
  }
  </code></pre>
  
  <p>then i want to do something like</p>
  
  <pre><code>session.CreateCriteria&lt;Entity&gt;().Add(myCriteria.ToNhCriteria())
  </code></pre>
  
  <p>to filter entities.
  The problem is that using Expression. methods (Expression.Or etc) is quite tedious (the method is generated and i have multiple or statements that have to be joined into an expression somehow).
  Is there a way to avoid using Expression.Or() and create ICrietrion / ICriteria using LINQ or HQL?</p>