public static bool TryBuildProvider(string fileName, out IMIRecordsProvider provider)
        {
            if (string.IsNullOrEmpty(fileName))
            {
                provider = null;
                return false;
            }

            string message = null;
            var res = new CSVFileRepository<MIDBRecord>(fileName).TestDbAccess(ref message);
            if (!res)
            {
                Logging.Logging.Instance.LogError(message, ErrorLevel.Error);
                provider = null;
                return false;
            }

            provider = new CSVFileProvider(fileName);
            return true;
        }
        public static bool TryBuildProvider(string fileName, out IMIRecordsProvider provider)
        {
            if (string.IsNullOrEmpty(fileName))
            {
                provider = null;
                return(false);
            }

            string message = null;
            var    res     = new CSVFileRepository <MIDBRecord>(fileName).TestDbAccess(ref message);

            if (!res)
            {
                Logging.Logging.Instance.LogError(message, ErrorLevel.Error);
                provider = null;
                return(false);
            }

            provider = new CSVFileProvider(fileName);
            return(true);
        }
        private static IList<Review> GetReviews()
        {
            var reviewCleaner = FileReviewsCleaner.GetReviewCleanerFromFile(_reviewCleanerCSV);
            var miDBRecordsGetter = new CSVFileProvider(_connectionString);
            var reviewBuilder = new ReviewBuilder(_logger, reviewCleaner, new InMemoryCleaner(), null);
            var reviewsManager = new ReviewsManager(reviewBuilder);

            var results = miDBRecordsGetter.GetRecords();

            foreach (var result in results)
            {
                try
                {
                    reviewsManager.AddReviewFrom(result);
                }
                catch (Exception e)
                {
                    _logger.LogError(string.Format("Une erreur est survenue lors du parsing de la review {0} : {1}", result.Id, e.Message), ErrorLevel.Error);
                    continue;
                }
            }

            return reviewsManager.Reviews;
        }