Ejemplo n.º 1
0
 public void InitNull(IdStorage ids)
 {
     _null.Clear();
     foreach (var id in ids.AsEnumerable())
     {
         if (!_phones[id].IsNotEmpty())
         {
             _null.Load(id);
         }
     }
     _null.LoadEnded();
 }
Ejemplo n.º 2
0
 public void InitNull(IdStorage ids)
 {
     _null.Clear();
     foreach (var id in ids.AsEnumerable())
     {
         if (_names[id] == 0)
         {
             _null.Load(id);
         }
     }
     _null.LoadEnded();
 }
Ejemplo n.º 3
0
 public void InitNull(IdStorage ids)
 {
     _null.Clear();
     foreach (var id in ids.AsEnumerable())
     {
         if (!_ids.Contains(id))
         {
             _null.Load(id);
         }
     }
     _null.LoadEnded();
 }
Ejemplo n.º 4
0
        public IIterator Filter(
            FilterRequest.EmailRequest email,
            DomainStorage domainStorage,
            IdStorage idStorage)
        {
            DelaySortedList <int> withDomain = null;

            if (email.Domain != null)
            {
                var domainId = domainStorage.Get(email.Domain);
                withDomain = _domain2ids.GetValueOrDefault(domainId);
            }

            IEnumerable <int> result = withDomain != null ? withDomain : idStorage.AsEnumerable();

            if (email.Gt != null && email.Lt != null)
            {
                if (string.Compare(email.Gt, email.Lt) > 0)
                {
                    return(ListHelper.EmptyInt);
                }

                return(result.Where(x =>
                {
                    string prefix = _emails[x].Prefix;
                    return string.Compare(prefix, email.Gt) > 0 &&
                    string.Compare(prefix, email.Lt) < 0;
                }).GetIterator());
            }

            if (email.Gt != null)
            {
                return(result
                       .Where(x => string.Compare(_emails[x].Prefix, email.Gt) > 0)
                       .GetIterator());
            }
            else if (email.Lt != null)
            {
                return(result
                       .Where(x => string.Compare(_emails[x].Prefix, email.Lt) < 0)
                       .GetIterator());
            }

            return(withDomain.GetIterator());
        }