Example #1
0
        protected override IEnumerable <AccountData> StartFilter(string value)
        {
            var names = value.Split(',');

            return(EnumeratorHelper.EnumerateUnique(_repo.FNameData.GetSortedIds(names))
                   .Select(x => _repo.Accounts[x]));
        }
        protected override IEnumerable <AccountData> StartFilter(string value)
        {
            var names = _repo.SNameData.GetSortedIdsStartsWith(value);

            return(EnumeratorHelper.EnumerateUnique(names).Select(x => _repo.Accounts[x]));

            ;
        }
        protected override IEnumerable <AccountData> StartFilter(HashSet <byte> value)
        {
            if (value.Count == 1)
            {
                return(_repo.InterestsData.GetSortedIds(value.First()).Select(x => _repo.Accounts[x]));
            }
            else
            {
                var interestsSorted = _repo.InterestsData.GetSortedIds(value);

                return(EnumeratorHelper.EnumerateDuplicates(interestsSorted).Select(x => _repo.Accounts[x]));
            }
        }
Example #4
0
        protected override IEnumerable <AccountData> StartFilter(int value)
        {
            if (value == 0)
            {
                return(EnumeratorHelper.EnumerateUnique(new[]
                {
                    _repo.PremiumData.GetSortedIds(PremiumIndex, false),
                    _repo.PremiumData.GetSortedIds(NonPremiumIndex, true)
                }).Select(x => _repo.Accounts[x]));

                ;
            }
            else
            {
                return(_repo.PremiumData.GetSortedIds(NonPremiumIndex, false).Select(x => _repo.Accounts[x]));

                ;
            }
        }
Example #5
0
        protected override IEnumerable <AccountData> StartFilter(string value)
        {
            var cityNames = value.Split(',').ToHashSet();

            if (cityNames.Count == 0)
            {
                if (!_repo.CityData.ContainsValue(cityNames.First()))
                {
                    return(Enumerable.Empty <AccountData>());
                }

                return(_repo.CityData.GetSortedIds(cityNames.First()).Select(x => _repo.Accounts[x]));
            }
            else
            {
                var ids = _repo.CityData.GetSortedIds(cityNames);

                return(EnumeratorHelper.EnumerateUnique(ids).Select(x => _repo.Accounts[x]));
            }
        }