/// <summary> /// Gets the actual sort by value from <see cref="NewDiscoverTVShow"/>. /// </summary> /// <param name="discover">The discover tv show instance.</param> /// <returns>A string value specific to the service.</returns> public static string GetSortByValue(this NewDiscoverTVShow discover) { string value = discover.SortBy switch { NewDiscoverTVShow.SortOptions.Popularity => "popularity", NewDiscoverTVShow.SortOptions.VoteAverage => "vote_average", NewDiscoverTVShow.SortOptions.FirstAirDate => "first_air_date", _ => throw new NotImplementedException(), }; return(GetStringValueWithDirection(value, discover.IsSortByAscending)); }
private static async Task DiscoverTVShowsAsync() { var discover = new NewDiscoverTVShow { SortBy = NewDiscoverTVShow.SortOptions.FirstAirDate, }; var items = await _service.DiscoverTVShowsAsync(discover); foreach (var item in items.Results) { Console.WriteLine("Name: {0}", item.Name); Console.WriteLine("FirstAirDate: {0}", item.FirstAirDate); Console.WriteLine("Overview: {0}", item.Overview); Console.WriteLine("******************************"); } }