Since upgrading from NH 3.0 to 3.1 I've been having some trouble using the following code:
criteria = session.CreateCriteria<User>()
.Add(SqlExpression.InG<User, int>(user => user.ID, toBeFechted)); // toBefetched is an IList<int>
This will compile fine but when running it I get an exception as soon as I add the In condition to the criteria.
System.MissingMethodException : Method not found: NHibernate.Criterion.AbstractCriterion NHibernate.Criterion.Restrictions.InG(System.String, System.Collections.Generic.ICollection1<**UNKNOWN TYPE**>).
at NHibernate.LambdaExtensions.SqlExpression.InG(Expression
1 expression, ICollection`1 values)
I can rebuild the query using QueryOver instead of Criteria and it will work, but doing that requires digging up alot of code that I don't have the time to do. Using NH 3.0 I did not have the problem.
Has something changed in NH 3.1 or am I having some weird dll problem?