Closed
Description
In an apparent regression between 5.2.7
and 5.3.0
this code will throw where it did not before:
q = q.Where(r => r.Labels == ((IntArray)labels).MappedAs(CustomType.IntArrayType));
HibernateException: MappedAs must be called on an expression which can be evaluated as ConstantExpression. It was call on UnaryExpression instead.
As a workaround removing the inline cast resolves the issue:
var convertedLabels = (IntArray)labels;
q = q.Where(r => r.Labels == convertedLabels.MappedAs(CustomType.IntArrayType));
This could possibly be a result of changes in #2365