public static ICriterion ProcessIsBetween(MethodCallExpression methodCallExpression) { MethodCallExpression betweenFunction = (MethodCallExpression)methodCallExpression.Object; string property = ExpressionProcessor.FindMemberExpression(betweenFunction.Arguments[0]); object lo = ExpressionProcessor.FindValue(betweenFunction.Arguments[1]); object hi = ExpressionProcessor.FindValue(methodCallExpression.Arguments[0]); return(Restrictions.Between(property, lo, hi)); }
public static ICriterion ProcessIsBetween(MethodCallExpression methodCallExpression) { MethodCallExpression betweenFunction = (MethodCallExpression)methodCallExpression.Object; ExpressionProcessor.ProjectionInfo projection = ExpressionProcessor.FindMemberProjection(betweenFunction.Arguments[0]); object lo = ExpressionProcessor.FindValue(betweenFunction.Arguments[1]); object hi = ExpressionProcessor.FindValue(methodCallExpression.Arguments[0]); return(projection.Create <ICriterion>(s => Restrictions.Between(s, lo, hi), p => Restrictions.Between(p, lo, hi))); }