title: Exception "Specified method is not supported." being thrown from NHibernate IQueryable expression when using .Any extension
body: <p>Utilizing NHibernate I am attempting to use a lambda expression to retrieve objects based on the status and values between a parent child relationship. <code>AbstractWorkflowRequestInformation</code> has a collection of <code>WorkflowRequestInformationAction</code>. Each of the two classes have their own Status properties. To illustrate here are the abbreviated classes as they relate to this query:</p>
  
  <pre><code>public class AbstractWorkflowRequestInformation
  {
      public virtual RequestStatus RequestStatus { get; set; }
  
      public virtual IEnumerable&lt;WorkflowRequestInformationAction&gt;
          WorkflowRequestInformationActionList { get; set; }
  }
  
  public class WorkflowRequestInformationAction
  {
      public virtual ActionStatus Status { get; set; }
  
      public virtual string RoleIdentifier { get; set; }
  
      public virtual string RoleName { get; set; }
  }
  </code></pre>
  
  <p>Given this relationship I want to retrieve AbstractWorkflowRequestInformation objects based on a <code>List&lt;KeyValuePair&lt;string, string&gt;&gt;</code> called roles. I realize that the exception is being caused by a lack of parsing of the <code>Any(...)</code> extension method, but I am unsure of alternative queries. Thus far all permutations on the below query have caused the same or similar exceptions:</p>
  
  <pre><code>public IEnumerable&lt;IRequestInformation&gt; GetRequestsPendingActionBy(
          List&lt;KeyValuePair&lt;string, string&gt;&gt; roles)
  {
      var results = GetSession().Query&lt;AbstractWorkflowRequestInformation&gt;()
          .Where(r =&gt; r.RequestStatus == RequestStatus.Pending
                      &amp;&amp; r.WorkflowRequestInformationActionList
                          .Any(a =&gt; ActionStatus.Pending == a.Status
                                    &amp;&amp; roles.Any(kp =&gt; kp.Key == a.RoleName
                                                 &amp;&amp; kp.Value == a.RoleIdentifier)))
      .ToList();
  
      return results;
  }
  </code></pre>
  
  <p>The ultimate goal is to retrieve only those <code>AbstractWorkflowRequestInformation</code> objects which are pending and have a pending WorkflowRequestInformationAction matching a KeyValuePair in the roles enumerable.</p>
  
  <p>I am not wedded to using a lambda expression as this expression has already grown unwieldy, if there's a more elegant ICriteria expression I am all ears. What are my options to restrict my results based upon the values in my <code>roles List&lt;KeyValuePair&lt;string, string&gt;&gt;</code> but prevent the "Specified method is not supported" exception?</p>