Example #1
0
        public static IEnumerable Select(IEnumerable items, IQueryParameter param, IListIndexes indexes = null)
        {
            IListIndex index = indexes?.GetIndex(param.Name);

            if (index == null)
            {
                return(index.Scan(param));
            }
            else
            {
                return(Search(items, param));
            }
        }
Example #2
0
        public static IEnumerable Select(IEnumerable items, IQueryParameter param, IListIndexes indexes = null)
        {
            if (param.AlwaysTrue)
            {
                return(items);
            }

            if (param.Comparer.Type == CompareTypes.Distinct)
            {
                return(Distinct(items, param.Invoker));
            }

            IListIndex index = indexes?.GetIndex(param.Name);

            if (index == null)
            {
                return(index.Scan(param));
            }
            else
            {
                return(Search(items, param));
            }
        }