title: Linq to NHibernate extensibility for custom string query operations?
body: <p>I would like to be able to use custom string querying within my NHibernate Linq expressions. Let's say for example (and this is just an example) I would like to be able to select entities containing a property which is an anagram of a particular string:</p>
  
  <pre><code>var myEntities = EntityRepository.AllEntities.Where(x =&gt; x.Description.IsAnagramOf('hits');
  </code></pre>
  
  <p>I imagine the steps involved in this process would be:</p>
  
  <ol>
  <li><p>Define a SQL Server UDF to determine
  whether two strings are anagrams.</p></li>
  <li><p>Define an extension method called
  IsAnagramOf() for the String
      class.</p></li>
  <li>(And this is the tricky one). Modify
  Linq to NHibernate's
      component for parsing expression
      trees so that it converts calls to
      the extension method into the
      appropriate SQL UDF call.</li>
  </ol>
  
  <p>My question is this. Does Linq to NHibernate contain some kind of extensibility model enabling me to 'slot in' my own custom string operations, or would I literally have to modify the existing source code to add in my shiznit to the expression tree parsing component?</p>