Exemplo n.º 1
0
        /// <summary>
        /// Load the District CSV data into the database
        /// This is the first step of the Processing
        /// </summary>
        private async Task Analyze()
        {
            if (!string.IsNullOrEmpty(Repo.CurrentHistory.LoadError))
            {
                throw new ProcessingException(Logger.Here(), "Can't Analyze with active LoadError.  Reload first.");
            }

            DateTime?lastLoaded = await Repo.GetLastLoadTime();

            if (!lastLoaded.HasValue)
            {
                throw new ProcessingException(Logger.Here(), "Data has never been loaded.");
            }

            var analyzer = new Analyzer(Logger, Repo);
            await analyzer.MarkDeleted(lastLoaded.Value);

            await analyzer.Analyze();
        }