/// <summary> /// Get search result by query from themoviedb API. /// </summary> /// <param name="query"></param> /// <returns></returns> public ActionResult Search(string q, int?page = 1) { SearchViewModel model = new SearchViewModel(); var data = _searchApi.MultiSearch(q, page.Value); model.q = q; model.page = data.page; model.total_results = data.total_results; model.SearchedResult = data.results.Where(x => x.media_type == "tv" || x.media_type == "movie").ToList(); return(View(model)); }
public SearchDTO MultiSearch(string query, int page) { var searchdata = _searchApi.MultiSearch(query, page); return(searchdata); }