Пример #1
0
        public async Task Run()
        {
            var unsortedUserDetails = await GetUserDetailsFromFile(_userDetailsConfigurations.UnsortedDetailsFilePath);

            if (unsortedUserDetails.Any())
            {
                var unsortedUserDetailsString = _textLineUtilityService.GetLinesAsSingleString(unsortedUserDetails);

                var users = _userDetailsService.GetOrderedUsersFromStringList(unsortedUserDetails);

                users.ForEach(u => Console.WriteLine($"{u.Name}, {u.Role}"));
                ;
            }

            Console.WriteLine(_consoleText.ExitProgram);
            Console.ReadLine();
        }
Пример #2
0
        public async Task WriteLinesToTextFileAsync(List <string> lines, string filePath)
        {
            string textToWrite = _textLineUtilityService.GetLinesAsSingleString(lines);

            await WriteToTextFileAsync(textToWrite, filePath);
        }