views:

67

answers:

0

I am having trouble using NHibernate's FutureValue method and nullable types. Is this a deficiency of NHibernate, or is the bug on my end? I can't think of a good work around.

This is the query I am trying to run:

Session.CreateCriteria<MyEntity>()
     .SetProjection(Projections.Min("NullableDecimalProperty"))
     .FutureValue<decimal?>();

When the minimum value is a null column, I receive the following exception:

System.ArgumentException: The value "" is not of type "System.Nullable`1[System.Decimal]" and cannot be used in this generic collection. Parameter name: value