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

RequestFeedback() private method

private RequestFeedback ( System.Guid id, string message, System.Guid instructors ) : System.Web.Mvc.ActionResult
id System.Guid
message string
instructors System.Guid
return System.Web.Mvc.ActionResult
        public ActionResult RequestFeedback(Guid id, string message, Guid[] instructors)
        {
            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 instructorsToNotify =
                RepositoryFactory.InstructorRepository.Queryable.Where(x => instructors.Contains(x.Id)).ToList();

            foreach (var instructor in instructorsToNotify)
            {
                experience.AddFeedbackRequest(new FeedbackRequest {Message = message, Instructor = instructor});
            }

            if (experience.InstructorViewable == false)
            {
                experience.InstructorViewable = true;
            }

            RepositoryFactory.ExperienceRepository.EnsurePersistent(experience);

            Message = string.Format("Feedback Requests sent successfully");

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