Hi,
I want to use a SqlFunctionProjection with the "IIF" registered function (I use the MsSql2000Dialect) but I can't figure it how.
The reason is that the IIS registered function uses the "Searched format" of the CASE function - "case when ?1 then ?2 else ?3 end". In this format the ?1 parameter must be an expression which evaluates to true or false. But the SqlFunctionProjection's constructor accepts only an array of IProjections as the function arguments:
public SqlFunctionProjection(string functionName, IType returnType, params IProjection[] args).
So, I can't pass an ICriterion as the first argument of the IIF function.
Anybody encountered this problem till now? Am I missing something here?
I know there is a ConditionalProjection I can use but if possible I'd rather prefer to use the SqlFunctionProjection.
Thanks,
Bogdan
|