NHibernate Error - Expression argument must be of type ICollection

Posted by Liam McLennan on Geeks with Blogs See other posts from Geeks with Blogs or by Liam McLennan
Published on Mon, 17 May 2010 19:20:47 GMT Indexed on 2010/05/18 1:32 UTC
Read the original article Hit count: 433

Filed under:

The above error occurred when I executed a linq query using the following expression:

(s) => s.Book.Slug.Equals(bookslug) && ids.Contains(s.Id);

ids in this case is of type IEnumerable<Guid>. As indicated by the error message the fix is to change ids to ICollection<Guid>, then the query executes successfully.

© Geeks with Blogs or respective owner