コード例 #1
0
        private List <Article> GetArticles(List <string> cheminArticles)
        {
            var articles = new List <Article>();

            cheminArticles.ForEach(chemin =>
            {
                try
                {
                    string articleBrut          = _fileReader.Read(chemin);
                    ArticleReader articleReader = ArticleReader.Create(articleBrut, chemin, _logger);
                    Article article             = articleReader.Read();
                    articles.Add(article);
                }
                catch (Exception ex)
                {
                    _logger.LogError("{messageError} {chemin}", ex, chemin);
                }
            });

            var articleOrdonnes = articles.OrderByDescending(s => s.Date[0]).ToList();

            _articles = articleOrdonnes;

            return(articleOrdonnes);
        }
コード例 #2
0
 public static ArticleReader CreateForTest(string articleBrut, ILogger logger)
 {
     return(ArticleReader.Create(articleBrut, null, logger));
 }