コード例 #1
0
        public ActionResult AllBadges()
        {
            var allBadges = _badgeService.GetAll().ToList();

            // Localise the badge names
            foreach (var item in allBadges)
            {
                var partialKey = string.Concat("Badge.", item.Name);
                item.DisplayName = LocalizationService.GetResourceString(string.Concat(partialKey, ".Name"));
                item.Description = LocalizationService.GetResourceString(string.Concat(partialKey, ".Desc"));
            }

            var badgesListModel = new AllBadgesViewModel
            {
                AllBadges = allBadges
            };

            return(View(badgesListModel));
        }