Exemple #1
0
        private async Task MainAsync()
        {
            var calculator = new AverageCalculator();
            var observer   = new SampleObserver(calculator);

            Subscribe(observer);
            Subscribe(observer);
            var averageValue = await calculator.GetAverageAsync().ConfigureAwait(false);

            Console.WriteLine("Average: {0}", averageValue);
        }
Exemple #2
0
 public SampleObserver(AverageCalculator averageCalculator)
 {
     _averageCalculator = averageCalculator;
 }