/// <summary> /// Display unique information for a specific review. /// </summary> /// <param name="id">ID of Review needing to be displayed</param> /// <returns></returns> public ActionResult ReviewDetails(int id) { ActionResult response; ReviewVM viewModel = new ReviewVM(); //check id if (id > 0) { //if id is valid, retrieve information from the database try { //access database, map to view model ReviewDO reviewDO = _ReviewDataAccess.ViewReviewByID(id); viewModel.Review = _ReviewMapper.MapDOtoPO(reviewDO); viewModel.User = _UserMapper.MapDOtoPO(_UserDataAccess.ViewUserByID(viewModel.Review.UserID)); viewModel.Game = _GameMapper.MapDOtoPO(_GameDataAccess.ViewGameByID(viewModel.Review.GameID)); response = View(viewModel); } catch (Exception ex) { //log error _Logger.ErrorLog(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ex); response = RedirectToAction("Error", "Home"); } finally { } } else { //if id is not valid, return to the list response = RedirectToAction("Index", "Review"); } return(response); }