NHibernate cannot convert an expression to an sql statement because it does not know what to do with x.FldCurrentFunding / x.FldFundingGoal. The solution rewrites this expression like this:
ISQLFunction sqlDiv = new VarArgsSQLFunction("(", "/", ")");
(...)
.Add(
Expression.Ge(
Projections.SqlFunction(
sqlDiv,
NHibernateUtil.Double,
Projections.Property("FldCurrentFunding"),
Projections.Property("FldCurrentGoal")
),
0.8m
)
)
(...)
Hope this gives you a few directions.
Peter source
share