public IDisposable Subscribe(IObserver <Observation> observer) { foreach (var observation in observationService.Get()) { if (observation.Country == "Poland") { observer.OnNext(observation); } } observer.OnCompleted(); return(null); }
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); } }