Exemplo n.º 1
0
        async protected override Task <DataListPageResult <TmdbItem> > FetchPageAsync(int pageNumber)
        {
            if (_config == null)
            {
                _config = await TheMovieDb.GetConfiguration();
            }

            var result = await TheMovieDb.SearchMovieAsync(_query, pageNumber);

            List <TmdbItem> list;

            if (result.Results != null)
            {
                list = result.Results.Select(MovieFactory).ToList();
            }
            else
            {
                list = new List <TmdbItem>();
            }

            return(new DataListPageResult <TmdbItem>(result.TotalResults, PageSize, pageNumber, list));
        }