public ActionResult Review(long surveyModelId) { try { var userIds = db.GetDistinctUserIdsFromInstances(surveyModelId); var userNames = new Dictionary <int, string>(); foreach (var userId in userIds) { var user = context.UserProfiles.Find(userId); if (user != null) { userNames.Add(userId, user.UserName); } } var surveyVM = db.CreateSurveyReviewViewModel(surveyModelId, userNames); return(View(surveyVM)); } catch (Exception ex) { Log.Error(ex.Message, ex); return(HttpNotFound()); } }