예제 #1
0
        static void RunSortedExample()
        {
            var simpleDataList = SimpleDataService.GerDefaultSimpleDataList();

            Console.WriteLine("Not sorted list:");

            foreach (var simpleData in simpleDataList)
            {
                Console.WriteLine($"{simpleData.Id}  {simpleData.Date.ToLongTimeString()}");
            }

            Console.WriteLine($"Count: {simpleDataList.Count}");


            Console.WriteLine("Sorted list:");

            var simpleDataSortedList = simpleDataList.OrderBy(entity => entity.Date);

            foreach (var simpleData in simpleDataSortedList)
            {
                Console.WriteLine($"{simpleData.Id}  {simpleData.Date.ToLongTimeString()}");
            }

            Console.WriteLine($"Count: {simpleDataList.Count}");
        }
예제 #2
0
        static void RunToSmtpExample()
        {
            var simpleDataList  = SimpleDataService.GerDefaultSimpleDataList();
            var simpleDataFirst = simpleDataList.First();
            var strings         = new[]
            {
                "123",
                "321",
                "312",
                "132"
            };



            Console.WriteLine($"За {simpleDataFirst.Date.ToShortDateString()} были запрошены следующие номера заявок: {Environment.NewLine} {strings.ToString()}");
        }
예제 #3
0
        static void RunToWriteStrinsExample()
        {
            var simpleDataList  = SimpleDataService.GerDefaultSimpleDataList();
            var simpleDataFirst = simpleDataList.First();
            var strings         = new[]
            {
                "123",
                "321",
                "312",
                "132"
            };

            var text = "test header:";

            foreach (var s in strings)
            {
                text += s;
                text += Environment.NewLine;
            }

            Console.WriteLine(text);
        }