Пример #1
0
        public IKeywordsBuilder <T> ForEach <TProp>(
            Func <T, IEnumerable <TProp> > func, Action <KeywordsBuilder <TProp> > action)
            where TProp : class
        {
            _items.Add(e =>
            {
                var vs = func(e);
                if (vs == null)
                {
                    return(null);
                }

                var b = new KeywordsBuilder <TProp>(_processor);
                action(b);

                return((vs).SelectMany(b.Build));
            });

            return(this);
        }
Пример #2
0
        public IKeywordsBuilder <T> For <TProp>(
            Func <T, TProp> func, Action <KeywordsBuilder <TProp> > action)
            where TProp : class
        {
            _items.Add(e =>
            {
                var v = func(e);
                if (v == null)
                {
                    return(null);
                }

                var b = new KeywordsBuilder <TProp>(_processor);
                action(b);

                return(b.Build(v));
            });

            return(this);
        }