Ejemplo n.º 1
0
        private TImageStatistic CreateInitialStatistic()
        {
            var newStat = new TImageStatistic
            {
                TotalNumberOfImages     = _imageRepository.AmounthOfItems(),
                NumberOfOptimizedImages = _imageRepository.AmounthOfOptimizedItems(),
                TotalSavedBytes         = 0
            };

            _statisticRepository.Create(newStat);
            return(newStat);
        }
Ejemplo n.º 2
0
        public void CreateStatistic()
        {
            var statistic = _statisticRepository.GetStatistic();

            if (statistic == null)
            {
                var newStat = new TImageStatistic
                {
                    TotalNumberOfImages     = _imageRepository.AmounthOfItems(),
                    NumberOfOptimizedImages = _imageRepository.AmounthOfOptimizedItems()
                };

                _statisticRepository.Create(newStat);
            }
        }