Пример #1
0
        public ContextualQueryBuilder Next(Action <ContextQueryBuilder> queryDefinition)
        {
            var queryBuilder = new ContextQueryBuilder();

            queryDefinition(queryBuilder);
            _next = queryBuilder.Build();
            return(this);
        }
Пример #2
0
        //public ContextualQueryBuilder BeforeNot(Action<ContextQueryBuilder> queryDefinition)
        //{
        //    var queryBuilder = new ContextQueryBuilder();
        //    queryDefinition(queryBuilder);
        //    _negLookBehind = queryBuilder.Build();
        //    return this;
        //}

        public ContextualQueryBuilder AfterNot(Action <ContextQueryBuilder> queryDefinition)
        {
            var queryBuilder = new ContextQueryBuilder();

            queryDefinition(queryBuilder);
            _negLookAhead = queryBuilder.Build();
            return(this);
        }
Пример #3
0
        public ContextualQueryBuilder Before(Action <ContextQueryBuilder> queryDefinition)
        {
            var queryBuilder = new ContextQueryBuilder();

            queryDefinition(queryBuilder);
            _lookBehind = queryBuilder.Build();
            return(this);
        }
Пример #4
0
        public ContextQueryBuilder Not(Action <ContextQueryBuilder> queryDefinition)
        {
            var queryBuilder = new ContextQueryBuilder();

            queryDefinition(queryBuilder);

            SetQuery(new NotQuery(queryBuilder.Build()));
            return(this);
        }
Пример #5
0
        public ContextQueryBuilder Twice(Action <ContextQueryBuilder> queryDefinition)
        {
            var queryBuilder = new ContextQueryBuilder();

            queryDefinition(queryBuilder);
            var query = queryBuilder.Build();

            SetQuery(new TwiceQuery(query));
            return(this);
        }
Пример #6
0
        public ContextQueryBuilder ZeroOrMany(Action <ContextQueryBuilder> queryDefinition)
        {
            var queryBuilder = new ContextQueryBuilder();

            queryDefinition(queryBuilder);
            var query = queryBuilder.Build();

            SetQuery(new ZeroOrManyQuery(query));
            return(this);
        }
Пример #7
0
        public ContextQueryBuilder Or(params Action <ContextQueryBuilder>[] queriesDefinitions)
        {
            var queries = queriesDefinitions.Select(qd =>
            {
                var queryBuilder = new ContextQueryBuilder();
                qd(queryBuilder);
                return(queryBuilder.Build());
            });

            SetQuery(new OrQuery(queries));
            return(this);
        }