Пример #1
0
        public IActionResult Index()
        {
            var dtoResult = SharedRepository.GetStatisics();

            var vm = new IndexViewModel()
            {
                CategoryCard = new StatisticEntityCardViewModel()
                {
                    LatestItemId   = dtoResult.CategoryStatistics.LatestItemId,
                    LatestItemName = dtoResult.CategoryStatistics.LatestItemName,
                    EntitiesCount  = dtoResult.CategoryStatistics.EntitiesCount,
                },
                RecipeCard = new StatisticEntityCardViewModel()
                {
                    LatestItemId   = dtoResult.RecipeStatistics.LatestItemId,
                    LatestItemName = dtoResult.RecipeStatistics.LatestItemName,
                    EntitiesCount  = dtoResult.RecipeStatistics.EntitiesCount,
                },
                IngredientCard = new StatisticEntityCardViewModel()
                {
                    LatestItemId   = dtoResult.IngredientStatistics.LatestItemId,
                    LatestItemName = dtoResult.IngredientStatistics.LatestItemName,
                    EntitiesCount  = dtoResult.IngredientStatistics.EntitiesCount,
                },
                PhotoCard = new StatisticEntityCardViewModel()
                {
                    LatestItemId   = dtoResult.PhotoStatistics.LatestItemId,
                    LatestItemName = dtoResult.PhotoStatistics.LatestItemName,
                    EntitiesCount  = dtoResult.PhotoStatistics.EntitiesCount,
                },
            };

            return(View(vm));
        }