Exemple #1
0
        private async Task AddVoterTurnout(long timestamp)
        {
            var result = await _voterTurnoutAggregator.GetVoterTurnoutFromBEC();

            if (result.IsSuccess)
            {
                result.Value.Timestamp = timestamp;
                await _resultsRepository.InsertCurrentVoterTurnout(result.Value);
            }
        }
        private async Task AddVoterTurnout(List <ElectionResultsFile> files, long timestamp)
        {
            var turnoutJson = files.FirstOrDefault(f => f.FileType == FileType.VoterTurnout);

            if (turnoutJson == null)
            {
                return;
            }
            var result = await _voterTurnoutAggregator.GetVoterTurnoutFromBEC(turnoutJson);

            if (result.IsSuccess)
            {
                result.Value.Timestamp = timestamp;
                await _resultsRepository.InsertCurrentVoterTurnout(result.Value);
            }
        }