title: NHibernate QueryOver: Variable 'line' of type 'SomeTable' referenced from scope '', but it is not defined
body: <p>I'm working with legacy data, which often brings me one information splited in multiple columns. I'm trying to reproduce the following SQL query...</p>
  
  <pre><code>SELECT * FROM SomeTable WHERE concat(DescriptionPart1,DescriptionPart2) LIKE 'TEST'
  </code></pre>
  
  <p>...using NHibernate QueryOver. So:</p>
  
  <pre><code>Dim myQuery = Me.Session.QueryOver(Of SomeTable).WhereRestrictionOn( _
      Function(line As SomeTable) line.DescriptionPart1 &amp; line.DescriptionPart2) _
      .IsLike("TEST")
  </code></pre>
  
  <p>This own statement will run into the following exception:</p>
  
  <pre><code>Variable 'line' of type 'SomeTable' referenced from scope '', but it is not defined
  </code></pre>
  
  <p>Any directions? I'm trying to avoid magic strings, but I'm always giving up to it (as using HQL the concatenation expression + like function works like a charm).</p>