Inheritance: IFilterExpression
Beispiel #1
0
        public void GenerateCondition(FilterBuildExpressionContext filterContext)
        {
            List <CollectionElementToken> allAny = Token.Follow(a => a.Parent)
                                                   .OfType <CollectionElementToken>()
                                                   .Where(a => !a.CollectionElementType.IsElement())
                                                   .Reverse()
                                                   .ToList();

            List <IFilterExpression> filters = filterContext.Filters;

            foreach (var ct in allAny)
            {
                var allAnyFilter = filterContext.AllAnyFilters.GetOrCreate(ct, () =>
                {
                    var newAllAnyFilter = new AnyAllFilter(ct);

                    filterContext.Replacemens.Add(ct, ct.CreateExpression(newAllAnyFilter.Parameter));

                    filters.Add(newAllAnyFilter);

                    return(newAllAnyFilter);
                });

                filters = allAnyFilter.Filters;
            }

            var exp = GetConditionBasic(filterContext);

            filters.Add(new FilterExpression(exp));
        }
Beispiel #2
0
        public void GenerateCondition(FilterBuildExpressionContext filterContext)
        {
            List<CollectionElementToken> allAny = Token.Follow(a => a.Parent)
                .OfType<CollectionElementToken>()
                .Where(a => !a.CollectionElementType.IsElement())
                .Reverse()
                .ToList();

            List<IFilterExpression> filters = filterContext.Filters;
            foreach (var ct in allAny)
            {
                var allAnyFilter = filterContext.AllAnyFilters.GetOrCreate(ct, () =>
                {
                    var newAllAnyFilter = new AnyAllFilter(ct);

                    filterContext.Replacemens.Add(ct, ct.CreateExpression(newAllAnyFilter.Parameter));

                    filters.Add(newAllAnyFilter);

                    return newAllAnyFilter;
                });

                filters = allAnyFilter.Filters;
            }

            var exp = GetConditionBasic(filterContext);

            filters.Add(new FilterExpression(exp));
        }