コード例 #1
0
ファイル: Moonwalk.cs プロジェクト: DimaTsetsik/masterThesis
        public async Task <MoonwalkModel[]> GetFilmByName(string filmName)
        {
            try
            {
                string url    = $"{Enumerator.GetMoonwalkUrl}title={filmName}&api_token={Enumerator.GetMoonwalkToken[0]}";
                var    result = await iWebClientHelper.GetWebReuestAsync <MoonwalkModel[]>(url);

                foreach (var item in result)
                {
                    if (item.title_en != null)
                    {
                        var imdbResult = await imdbService.GetFilmByName(item.title_en);

                        if (imdbResult.Poster != null)
                        {
                            item.posret = imdbResult.Poster;
                        }
                    }
                }
                return(result);
            }
            catch (Exception e)
            {
                throw new Exception($"Internal f****d error: {e.Data}");
            }
        }
コード例 #2
0
        public async Task <GoogleBookModel> GetBooksByNameAsync(string name, int startIndex = 0, int itemsOnPage = 12)
        {
            string url = $"{Enumerator.GetGoogleBooksApiUrl}{name}{"&startIndex="}{startIndex}{"&maxResults="}{itemsOnPage}";

            var result = await iWebClientHelper.GetWebReuestAsync <GoogleBookModel>(url);

            return(result);
        }
コード例 #3
0
        public async Task <ImdbEntity> GetFilmByName(string filmName)
        {
            try
            {
                string url    = $"{Enumerator.GetImDbApiUrl}{filmName}&{Enumerator.GetImDbapiToken}";
                var    result = await iWebClientHelper.GetWebReuestAsync <ImdbEntity>(url);

                return(result);
            }
            catch (Exception e)
            {
                throw new Exception($"Internal f****d error: {e.Data}");
            }
        }