Example #1
0
        public void UpdateStatistic()
        {
            var statistic = _statisticRepository.GetStatistic() ?? CreateInitialStatistic();

            statistic.TotalNumberOfImages     = _imageRepository.AmounthOfItems();
            statistic.NumberOfOptimizedImages = _imageRepository.AmounthOfOptimizedItems();
            statistic.TotalSavedBytes         = _statisticRepository.GetTotalSavedBytes();

            _statisticRepository.Update(statistic);
        }
        public void UpdateStatistic()
        {
            var statistic = _statisticRepository.GetStatistic();

            if (statistic != null)
            {
                statistic.TotalNumberOfImages     = _imageRepository.AmounthOfItems();
                statistic.NumberOfOptimizedImages = _imageRepository.AmounthOfOptimizedItems();
                _statisticRepository.Update(statistic);
            }
        }