Exemplo n.º 1
0
        public IDisposable Subscribe(IObserver <Observation> observer)
        {
            foreach (var observation in observationService.Get())
            {
                if (observation.Country == "Poland")
                {
                    observer.OnNext(observation);
                }
            }

            observer.OnCompleted();

            return(null);
        }
Exemplo n.º 2
0
        public void Convert()
        {
            var observations = observationService.Get();

            var continents = locationService.Get();

            foreach (var observation in observations)
            {
                observation.Continent = continents.SingleOrDefault(c => c.Country == observation.Country)?.Continent;

                logService.Add(observation);

                progress?.Report(observation);
            }
        }