Beispiel #1
0
        public async Task <IViewComponentResult> InvokeAsync()
        {
            CountersViewModel model = new CountersViewModel();

            OperationResultVo <int> gamesCount = gameAppService.Count(CurrentUserId);

            if (gamesCount.Success)
            {
                model.GamesCount = gamesCount.Value;
            }

            OperationResultVo <int> usersCount = profileAppService.Count(CurrentUserId);

            if (usersCount.Success)
            {
                model.UsersCount = usersCount.Value;
            }

            model.ArticlesCount = contentService.CountArticles();

            OperationResultVo <int> teamCount = teamAppService.CountNotSingleMemberGroups(CurrentUserId);

            if (teamCount.Success)
            {
                model.TeamCount = teamCount.Value;
            }

            return(await Task.Run(() => View(model)));
        }