title: linq query on list id's
body: <p>I have a list of id's and I need to get all records correscponding to each id in the list .</p>
  
  <p>below is the sample code</p>
  
  <pre><code>public List&lt;Items&gt; LoadLineItemByPkeys(IEnumerable&lt;long&gt; ItemId)
  {
      var ItemList = CurrentSession.Query&lt;LineItem&gt;()
        .Where(l =&gt;itemId.Contains(l.id))
        .ToList();
      return ItemList ;
  }
  </code></pre>
  
  <p>but i am getting exception</p>
  
  <blockquote>
    <p>An exception of type 'NHibernate.Exceptions.GenericADOException' occurred in NHibernate.dll but was not handled in user code</p>
  </blockquote>
  
  <p>inner exception:-</p>
  
  <blockquote>
    <p>Failed to convert parameter value from a WhereSelectArrayIterator`2 to a Int64.
    Please help me on this.</p>
  </blockquote>
  
  <p>when i executed same query in LINQPad, i am getting the results.</p>