input B:"); var b = Convert.ToInt32(Console.ReadLine()); var c = a+b; Console.WriteLine("before: the value of c is {0}",c); Console.Write("Press input B again:"); b = Convert.ToInt32(Console.ReadLine()); c = a+b; Console.WriteLine("after: the value of c is {0}",c); Imperative programming
= Convert.ToInt32(Console.ReadLine()); Console.Write("Press input B:"); var subscription = Observable .FromAsync(() => Console.In.ReadLineAsync()) .Subscribe(b => Console.WriteLine("the value of c is {0}",a+Convert.ToInt32(b))); Console.Write("enter symbol (or x to exit): "); … } Reactive programming
"James"}.ToObservable(); IObservable<string> subject = Observable.FromAsync (() => Console.In.ReadLineAsync ()); IObservable<int> subject = Observable.Range(5, 8); IObservable<int> subject = from i in Observable.Range(1, 100) from j in Observable.Range(1, 100) from k in Observable.Range(1, 100) where k * k == i * i + j * j select new { a = i, b = j, c = k }; IObservable<long> subject = Observable.Timer(TimeSpan.FromSeconds(3)); Subject
Reactive Extensions (Rx) - Bart De Smet The introduction to Reactive Programming you've been missing A Playful Introduction to Rx by Erik Meijer [YouTube] Playlist - Reactive Extensions for .NET (Rx.NET)