コード例 #1
0
        public void WhenIAccessTheLastPersonDetails()
        {
            var listFeature   = _container.GetInstance <IPersonListFeature>();
            var lastId        = listFeature.Exec().Last().Id;
            var detailFeature = _container.GetInstance <IPersonDetailFeature>();

            _personDetail = detailFeature.Exec(lastId);
        }
コード例 #2
0
ファイル: PersonService.cs プロジェクト: nazimaraz/Sinefilim
        private Person GetPersonDetailsFromTmdb(int tmdbId)
        {
            string url = $"https://api.themoviedb.org/3/person/{tmdbId}?api_key={apiKey}&language=en-US";

            using WebClient webClient = new WebClient();
            string jsonData = string.Empty;

            jsonData = webClient.DownloadString(url);
            PersonDetailsResponse response = JsonConvert.DeserializeObject <PersonDetailsResponse>(jsonData);

            return(new Person
            {
                TmdbId = response.id,
                ImdbId = response.imdb_id,
                Gender = response.gender,
                Name = response.name,
                PosterUrl = response.profile_path
            });
        }