I have a search field that returns a list of movies. It works fine if I reference the model as @MovieSearch in the View. But I want to use pagination so it won't break with thousands of results if someone types "a".
I'm trying to use X.PagedList, but when I use IPagedList<MovieSearch> as model I can't access the MovieSearchResults[] results property inside MovieSearch in the View, and that contains most of the data I want to retrieve from the search.
Basically I can't access anything inside "results" below.
public class MovieSearch
{
public int? page { get; set; }
public MovieSearchResult[]? results { get; set; }
public int? total_pages { get; set; }
public int total_results { get; set; }
}
public class MovieSearchResult
{
public string? backdrop_path { get; set; }
public string? first_air_date { get; set; }
public int[]? genre_ids { get; set; }
public int? id { get; set; }
public string? title { get; set; }
public string[]? origin_country { get; set; }
public string? original_language { get; set; }
public string? original_title { get; set; }
public string? overview { get; set; }
public float? popularity { get; set; }
public string? poster_path { get; set; }
public float? vote_average { get; set; }
public int? vote_count { get; set; }
}
The search results come as objects from a SearchMovies method, I'm not accessing any local DB. This model comes from the API.
Any ideas?