Пример #1
0
        private async Task LoadMovieDetailsAsync()
        {
            var apiKey      = ConfigurationManager.AppSettings["tmdb:ApiKey"];
            var movieClient = new MovieClient(apiKey);
            var id          = Request.QueryString["id"];
            var movie       = await movieClient.GetMovieAsync(id);

            DetailsView1.DataSource = new Movie[] { movie };
            DetailsView1.DataBind();

            RptCast.DataSource = movie.Credits.Where(x => x.IsCast).ToList();
            RptCast.DataBind();

            RptCrew.DataSource = movie.Credits.Where(x => !x.IsCast).ToList();
            RptCrew.DataBind();

            ViewState["Movie"] = movie;
        }
        private void LoadLocalMovieDetails()
        {
            if (int.TryParse(Request.QueryString["id"], out int id))
            {
                var movie = MovieService.GetMovie(id);

                DetailsView1.DataSource = new Movie[] { movie };
                DetailsView1.DataBind();

                RptCast.DataSource = movie.Credits.Where(x => x.IsCast).ToList();
                RptCast.DataBind();

                RptCrew.DataSource = movie.Credits.Where(x => !x.IsCast).ToList();
                RptCrew.DataBind();

                RptNominations.DataSource = movie.Nominations.Where(x => x.Category != null).ToList();
                RptNominations.DataBind();
            }
        }