コード例 #1
0
        public virtual async Task <ActionResult> Compare(string userName)
        {
            var leftLeaderboardItem = await LeaderboardItem.GetLeaderboardForUserName(AuthenticatedUser.UserName);

            var rightLeaderboardItem = await LeaderboardItem.GetLeaderboardForUserName(userName);

            var allBadges = await BadgeCollection.GetAllBadgesByTypeAsync(BadgeType.Unset);

            var allActivities = await ActivityCollection.GetAllActivitiesAsync(false);

            var leaderboardCompareViewModel = new LeaderboardCompareViewModel();

            leaderboardCompareViewModel.LeftLeaderboardItem  = leftLeaderboardItem;
            leaderboardCompareViewModel.RightLeaderboardItem = rightLeaderboardItem;
            leaderboardCompareViewModel.AllBadges            = allBadges;
            leaderboardCompareViewModel.AllActivities        = allActivities;

            return(View(leaderboardCompareViewModel));
        }
コード例 #2
0
        public virtual async Task <ActionResult> Show(string userName)
        {
            var leaderboardItem = await LeaderboardItem.GetLeaderboardForUserName(userName);

            return(View(leaderboardItem));
        }