public ActionResult Index(int wizardId) { var wizard = _planningService.GetWizard(new WizardRequest() { PlanningWizardID = wizardId }); if (wizard == null) { throw new Exception("Invalid Wizard ID: " + wizardId); } var enrollmentStatus = _planningService.GetEnrollmentStatus(AssistedUser.UserID); var enrollmentInterest = enrollmentStatus.EnrollmentInterests.First(i => i.Name == wizard.Name); if (!enrollmentInterest.Interested) { throw new Exception("According to this user's enrollment profile, this planning tool is locked."); } return(View(wizard)); }