public IIterator Filter( FilterRequest.CityRequest city, IdStorage ids, CityStorage cities) { if (city.IsNull.HasValue) { if (city.IsNull.Value) { return((city.Eq == null && city.Any.Count == 0) ? _null.GetIterator() : ListHelper.EmptyInt); } } if (city.Eq != null && city.Any.Count > 0) { if (city.Any.Contains(city.Eq)) { short cityId = cities.Get(city.Eq); return(_id2AccId[cityId]?.GetIterator() ?? ListHelper.EmptyInt); } else { return(ListHelper.EmptyInt); } } if (city.Eq != null) { short cityId = cities.Get(city.Eq); return(_id2AccId[cityId]?.GetIterator() ?? ListHelper.EmptyInt); } else if (city.Any.Count > 0) { return(ListHelper .MergeSort( city.Any .Select(x => cities.Get(x)) .Where(x => _id2AccId[x] != null) .Select(x => _id2AccId[x].GetIterator()) .ToList())); } else { return(_ids.GetIterator()); } }
public IEnumerable <int> Filter( GroupRequest.CityRequest city, CityStorage cities) { short cityId = cities.Get(city.City); if (_id2AccId[cityId] != null) { return(_id2AccId[cityId]); } else { return(Enumerable.Empty <int>()); } }