Exemplo n.º 1
0
        private static void BlockStyleUsingLinqLikeSyntaxRoutine()
        {
            var request = new RangeRequest {
                Start = 1, Count = 10
            };

            var handler = new RangeEnumerator().Select(x => x * x * x)
                          .Select(x => x / 2)
                          .Where(x => x % 2 == 1)
                          .ForEach(Console.WriteLine);

            handler.Handle(request);
        }
Exemplo n.º 2
0
        private static void BlockStyleRoutine()
        {
            var request = new RangeRequest {
                Start = 1, Count = 10
            };

            var handler = new RangeEnumerator().Forward(Select <int, int> .Apply(x => x * x * x))
                          .Forward(Select <int, int> .Apply(x => x / 2))
                          .Forward(Where <int> .Apply(x => x % 2 == 1))
                          .Forward(ForEach <int> .Apply(Console.WriteLine));

            handler.Handle(request);
        }