Badges.Controllers.StudentController.RemoveOutcome C# (CSharp) Method

RemoveOutcome() private method

private RemoveOutcome ( System.Guid id, System.Guid experienceOutcomeId ) : System.Web.Mvc.ActionResult
id System.Guid
experienceOutcomeId System.Guid
return System.Web.Mvc.ActionResult
        public ActionResult RemoveOutcome(Guid id, Guid experienceOutcomeId)
        {
            var experience =
                RepositoryFactory.ExperienceRepository.Queryable.SingleOrDefault(
                    x => x.Id == id && x.Creator.Identifier == CurrentUser.Identity.Name);

            if (experience == null)
            {
                return new HttpNotFoundResult("Could not find the requested experience");
            }

            var outcome = experience.ExperienceOutcomes.Single(x => x.Id == experienceOutcomeId);

            experience.ExperienceOutcomes.Remove(outcome);
            experience.SetModified();

            RepositoryFactory.ExperienceRepository.EnsurePersistent(experience);

            return RedirectToAction("ViewExperience", "Student", new { id });
        }