示例#1
0
        public void WriteText(IEnumerable <Word> words)
        {
            if (words is null)
            {
                throw new System.ArgumentNullException(nameof(words));
            }

            var sb = new StringBuilder();

            foreach (var word in words)
            {
                sb.AppendLine(_documentWriter.GetText(word));
            }

            File.WriteAllTextAsync(_wordFilesStoredSettings.DestinyLocation, sb.ToString());
            _logger.LogInformation("Words file written on {destinyLocation}", Path.GetFullPath(_wordFilesStoredSettings.DestinyLocation));
        }