public ActionResult Create([Bind(Include = "SeasonID,SeasonNo,Episode,MoviesSeriesID")] Season season) { if (ModelState.IsValid) { _seasonService.Add(season); return(RedirectToAction("Index")); } ViewBag.MoviesSeriesID = new SelectList(_moviesSeriesService.GetAll(), "MovieSeriesID", "MovieSeriesName", season.MoviesSeriesID); return(View(season)); }
// GET: Home public ActionResult Index() { //int score = 0; //decimal averageImdb; //int ratingCount = 0; //List<MoviesSeries> movies; //foreach (var movie in _moviesSeriesService.GetAll()) //{ // ratingCount = _ratingService.GetRatingByMoviesID(movie.MovieSeriesID).Count(); // foreach (var item in _ratingService.GetRatingByMoviesID(movie.MovieSeriesID)) // { // score += item.Score; // } // averageImdb = (decimal)score / ratingCount; // movies.Add(averageImdb); //} //ViewBag.AllRating = Decimal.Round(averageImdb, 1); return(View(_moviesSeriesService.GetAll())); }
// GET: Home public ActionResult Index() { return(View(_moviesSeriesService.GetAll())); }