Badges.Areas.Admin.Controllers.RevokeBadgeController.ViewBadges C# (CSharp) Method

ViewBadges() public method

public ViewBadges ( string id ) : System.Web.Mvc.ActionResult
id string
return System.Web.Mvc.ActionResult
        public ActionResult ViewBadges(string id)
        {
            // HTTP 404 if no student has this ID
            if (!RepositoryFactory.UserRepository.Queryable.Any(x => x.Identifier.Equals(id) && x.Roles.Any(r => r.Id == RoleNames.Student))) return HttpNotFound();

            // Display the granted badges of the given student
            var badgesList = RepositoryFactory.BadgeSubmissionRepository.Queryable.Where(x => x.Creator.Identifier.Equals(id) && x.Approved)
                                 .OrderByDescending(x => x.CreatedOn).Fetch(x => x.Badge).ToList();

            return View(badgesList);
        }