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}"); }
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()}"); }
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); }