Пример #1
0
 private static void Main(string[] args)
 {
     var data = new Repo().All();
     PrintExercise(data, 1);
     PrintExercise(data, 2);
     PrintExercise(data, 3);
     Console.ReadLine();
 }
Пример #2
0
        private static void Main(string[] args)
        {
            var data = new Repo().All();

            //This example does not include all required fields for output.
            data.SelectMany(invoice => invoice.LineItems)
                .ToList()
                .ForEach(Console.WriteLine);

            Console.ReadLine();
        }
Пример #3
0
        private static void Main(string[] args)
        {
            var data = new Repo().All();

            // Exercise 1
            data.ToList().ForEach(InvoiceHelper.ExerciseOne);
            data.ToList().ForEach(x => {
                Console.WriteLine(string.Format("Invoice #:{0}", x.InvoiceNo));
                x.LineItems.ToList().ForEach(Console.WriteLine);
                Console.WriteLine();
            });
            Console.ReadLine();

            // Exercise 2
            data.ToList().ForEach(InvoiceHelper.ExerciseTwo);
            data.ToList().ForEach(Console.Write);
            Console.ReadLine();

            // Exercise 3
            data.ToList().ForEach(InvoiceHelper.ExerciseThree);
            data.ToList().ForEach(Console.Write);
            Console.ReadLine();
        }