Ejemplo n.º 1
0
        private async Task LoadMoviesAsync()
        {
            var apiKey        = ConfigurationManager.AppSettings["tmdb:ApiKey"];
            var movieClient   = new MovieClient(apiKey);
            var searchedMovie = TextBox1.Text;

            try
            {
                var movies = await movieClient.SearchMovieAsync(searchedMovie);

                MoviesDataList.DataSource = movies;
                MoviesDataList.DataBind();
            }
            catch (Exception e)
            {
                TextBox1.Text = e.Message;
            }
        }
Ejemplo n.º 2
0
        private async Task LoadMoviesAsync()
        {
            var environmentKey = Environment.GetEnvironmentVariable("TMDB_API_KEY");
            var movieClient    = new MovieClient(environmentKey);
            var searchedMovie  = TextBox1.Text;

            try
            {
                var movies = await movieClient.SearchMovieAsync(searchedMovie);

                MoviesDataList.DataSource = movies.Results;
                MoviesDataList.DataBind();
            }
            catch (Exception e)
            {
                TextBox1.Text = e.Message;
            }
        }