private static PlayerSeason GetOrCreatePlayerSeason(Player player, Season season) { var playerSeason = player.Seasons.Find(ps => ps.SeasonId == season.Id); if (playerSeason == null) { playerSeason = PlayerHandler.AddPlayerSeason(new PlayerSeason { PlayerId = player.Id, SeasonId = season.Id }); // add default rating RatingHandler.AddRating(playerSeason.CreatePlayerRating()); } return(playerSeason); }
public IActionResult Review(ReviewViewModel viewModel, bool next) { if (ModelState.IsValid) { ratingHandler.AddRating(viewModel.Post); } else { var video = assignHandler.AssignRandomVideo(HttpContext.Session.GetUsernameKey()); ViewBag.VideoIdentity = video.UrlIdentity; ViewBag.VideoLink = assignHandler.GetVideoLink(video.UrlIdentity); return(View(categoryHandler.GetTier1s())); } if (next == true) { return(RedirectToAction("Review")); } else { return(RedirectToAction("Dashboard", "Home")); } }