title: How to use join with multiple conditions in linq-to-Nhibernate
body: <p>I have two classes (Request &amp; RequestDetail). I need to a <code>Linq To NHibernate</code>query between two classes by join.</p>
  
  <pre><code>var q = SessionInstance.Query&lt;Request&gt;()
         .Where(x =&gt; x.State == "Init");
  
  var q2 = SessionInstance.Query&lt;RequestDetail&gt;();
  q2 = q2.Where(xx =&gt; xx.Purpose.Contains("Purpose Sample")); // This line has a error When execution ‍‍`q.ToList()‍`
  
  q = q.Join(q2, request =&gt; request.Id, detail =&gt; detail.Id, (request, detail) =&gt; request);
  
  return q.ToList();
  </code></pre>
  
  <p>When I added a <code>Where</code> condition to <code>q2</code>, Result has a runtime error. Message of exception is : <code>Specified method is not supported.</code></p>
  
  <p>Stack Trace : </p>
  
  <pre><code>   at NHibernate.Hql.Ast.ANTLR.PolymorphicQuerySourceDetector.GetClassName(IASTNode querySource)
     at NHibernate.Hql.Ast.ANTLR.PolymorphicQuerySourceDetector.Process(IASTNode tree)
     at NHibernate.Hql.Ast.ANTLR.AstPolymorphicProcessor.Process()
     at NHibernate.Hql.Ast.ANTLR.ASTQueryTranslatorFactory.CreateQueryTranslators(IASTNode ast, String queryIdentifier, String collectionRole, Boolean shallow, IDictionary`2 filters, ISessionFactoryImplementor factory)
     at NHibernate.Hql.Ast.ANTLR.ASTQueryTranslatorFactory.CreateQueryTranslators(String queryIdentifier, IQueryExpression queryExpression, String collectionRole, Boolean shallow, IDictionary`2 filters, ISessionFactoryImplementor factory)
     at NHibernate.Engine.Query.QueryPlanCache.GetHQLQueryPlan(IQueryExpression queryExpression, Boolean shallow, IDictionary`2 enabledFilters)
     at NHibernate.Impl.AbstractSessionImpl.GetHQLQueryPlan(IQueryExpression queryExpression, Boolean shallow)
     at NHibernate.Impl.AbstractSessionImpl.CreateQuery(IQueryExpression queryExpression)
     at NHibernate.Linq.NhQueryProvider.PrepareQuery(Expression expression, IQuery&amp; query, NhLinqExpression&amp; nhQuery)
     at NHibernate.Linq.NhQueryProvider.Execute[TResult](Expression expression)
     at Remotion.Data.Linq.QueryableBase`1.GetEnumerator()
     at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
     at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
  </code></pre>
  
  <p>Why?</p>