Пример #1
0
            public override HqlTreeNode BuildHql(MethodInfo method, Expression targetObject, ReadOnlyCollection<Expression> arguments, HqlTreeBuilder treeBuilder, IHqlExpressionVisitor visitor)
            {
                // All has two arguments.  Arg 1 is the source and arg 2 is the predicate
                var predicate = (LambdaExpression)arguments[1];

                return treeBuilder.Not(
                    treeBuilder.Exists(
                        treeBuilder.Query(
                            treeBuilder.SelectFrom(
                                treeBuilder.From(
                                    treeBuilder.Range(
                                        visitor.Visit(arguments[0]),
                                        treeBuilder.Alias(predicate.Parameters[0].Name))
                                    )
                                ),
                            treeBuilder.Where(
                                treeBuilder.Not(visitor.Visit(arguments[1]).AsBooleanExpression())
                                )
                            )
                        )
                    );
            }