public ActionResult ViewDeactivated() { if (Int32.Parse(User.FindFirstValue(ClaimTypes.Role)) == 1) { var userProfiles = _userProfileRepository.GetAllDeactivatedUserProfiles(); userProfiles.Sort((x, y) => string.Compare(x.DisplayName, y.DisplayName)); return(View(userProfiles)); } else { return(RedirectToAction("Index", "Home")); } }