当前位置: 首页>>代码示例>>C#>>正文


C# Request.ProcesRequestAsync方法代码示例

本文整理汇总了C#中Request.ProcesRequestAsync方法的典型用法代码示例。如果您正苦于以下问题:C# Request.ProcesRequestAsync方法的具体用法?C# Request.ProcesRequestAsync怎么用?C# Request.ProcesRequestAsync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Request的用法示例。


在下文中一共展示了Request.ProcesRequestAsync方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetMovieByImdbAsync

 /// <summary>
 /// Gets a movie by the IMDB id.
 /// </summary>
 /// <param name="imdbId">The IMDB id</param>
 /// <returns>The specified movie.</returns>
 public static async Task<Movie> GetMovieByImdbAsync(string imdbId)
 {
     var request = new Request<Movie>("movie/" + imdbId);
     if (!string.IsNullOrEmpty(Language))
         request.AddParameter("language", Language);
     return await request.ProcesRequestAsync();
 }        
开发者ID:Fishes,项目名称:TMDbWrapper,代码行数:12,代码来源:TheMovieDbMovie.cs

示例2: GetConfig

 private static Configuration.Configuration GetConfig()
 {
     Request<Configuration.Configuration>.Initialize(UseSecureConnections);
     var request = new Request<Configuration.Configuration>("configuration");
     var config = request.ProcesRequestAsync().Result;
     return config;
 }
开发者ID:Fishes,项目名称:TMDbWrapper,代码行数:7,代码来源:TheMovieDb.cs

示例3: GetCompanyAsync

 /// <summary>
 /// Gets a specific company
 /// </summary>
 /// <param name="companyId">Id of the requested company.</param>
 /// <returns>The company that is associated to the id.</returns>
 public static async Task<Company> GetCompanyAsync(int companyId)
 {
     var company = DatabaseCache.GetObject<Company>(companyId);
     if (company == null)
     {
         var request = new Request<Company>("company/" + companyId);
         company = await request.ProcesRequestAsync();
         DatabaseCache.SetObject(companyId, company);
     }
     return company;
 }
开发者ID:Fishes,项目名称:TMDbWrapper,代码行数:16,代码来源:TheMovieDbCompany.cs

示例4: GetCreditsAsync

 /// <summary>
 /// Get the credits of a specific movie.
 /// </summary>
 /// <param name="personId">The id of the person.</param>
 /// <returns>The credits.</returns>
 public static async Task<Credit> GetCreditsAsync(int personId)
 {
     var credits = DatabaseCache.GetObject<Credit>(personId);
     if (credits == null)
     {
         var request = new Request<Credit>("person/" + personId + "/credits");
         credits = await request.ProcesRequestAsync();
         DatabaseCache.SetObject(personId, credits);
     }
     return credits;
 }
开发者ID:Fishes,项目名称:TMDbWrapper,代码行数:16,代码来源:TheMovieDbPerson.cs

示例5: GetCreditsAsync

 /// <summary>
 /// Get the credits of a specific movie.
 /// </summary>
 /// <param name="PersonID">The id of the person.</param>
 /// <returns>The credits.</returns>
 public static async Task<Credit> GetCreditsAsync(int PersonID)
 {
     Credit credits = DatabaseCache.GetObject<Credit>(PersonID);
     if (credits == null)
     {
         Request<Credit> request = new Request<Credit>("person/" + PersonID.ToString() + "/credits");
         credits = await request.ProcesRequestAsync();
         DatabaseCache.SetObject(PersonID, credits);
     }
     return credits;
 }
开发者ID:ThadT,项目名称:TMDbWrapper,代码行数:16,代码来源:TheMovieDbPerson.cs

示例6: GetCompanyAsync

 /// <summary>
 /// Gets a specific company
 /// </summary>
 /// <param name="CompanyId">Id of the requested company.</param>
 /// <returns>The company that is associated to the id.</returns>
 public static async Task<Company> GetCompanyAsync(int CompanyId)
 {
     Company company = DatabaseCache.GetObject<Company>(CompanyId);
     if (company == null)
     {
         Request<Company> request = new Request<Company>("company/" + CompanyId.ToString());
         company = await request.ProcesRequestAsync();
         DatabaseCache.SetObject(CompanyId, company);
     }
     return company;
 }
开发者ID:Rawrpwnzl,项目名称:TMDbWrapper,代码行数:16,代码来源:TheMovieDbCompany.cs

示例7: GetCollectionImagesAsync

 /// <summary>
 /// Gets the images that are associated with the collection.
 /// </summary>
 /// <param name="CollectionId">Id of the collection</param>
 /// <returns>The image set of the collection.</returns>
 public static async Task<Images> GetCollectionImagesAsync(int CollectionId)
 {
     Images images = DatabaseCache.GetObject<Images>(CollectionId);
     if (images != null)
     {
         Request<Images> request = new Request<Images>("collection/" + CollectionId.ToString() + "/images");
         images = await request.ProcesRequestAsync();
         DatabaseCache.SetObject(CollectionId, images);
     }
     return images;
 }
开发者ID:Rawrpwnzl,项目名称:TMDbWrapper,代码行数:16,代码来源:TheMovieDbCollection.cs

示例8: GetCollectionAsync

 /// <summary>
 /// Get a specific collection
 /// </summary>
 /// <param name="CollectionId">Id of the collection</param>
 /// <returns>The collection</returns>
 public static async Task<Collection> GetCollectionAsync(int CollectionId)
 {
     Collection collection = DatabaseCache.GetObject<Collection>(CollectionId);
     if (collection != null)
     {
         Request<Collection> request = new Request<Collection>("collection/" + CollectionId.ToString());
         collection = await request.ProcesRequestAsync();
         DatabaseCache.SetObject(CollectionId, collection);
     }
     return collection;
 }
开发者ID:Rawrpwnzl,项目名称:TMDbWrapper,代码行数:16,代码来源:TheMovieDbCollection.cs

示例9: GetCollectionImagesAsync

 /// <summary>
 /// Gets the images that are associated with the collection.
 /// </summary>
 /// <param name="collectionId">Id of the collection</param>
 /// <returns>The image set of the collection.</returns>
 public static async Task<Image> GetCollectionImagesAsync(int collectionId)
 {
     var images = DatabaseCache.GetObject<Image>(collectionId);
     if (images != null)
     {
         var request = new Request<Image>("collection/" + collectionId + "/images");
         images = await request.ProcesRequestAsync();
         DatabaseCache.SetObject(collectionId, images);
     }
     return images;
 }
开发者ID:Fishes,项目名称:TMDbWrapper,代码行数:16,代码来源:TheMovieDbCollection.cs

示例10: GetCollectionAsync

 /// <summary>
 /// Get a specific collection
 /// </summary>
 /// <param name="collectionId">Id of the collection</param>
 /// <returns>The collection</returns>
 public static async Task<Collection> GetCollectionAsync(int collectionId)
 {
     var collection = DatabaseCache.GetObject<Collection>(collectionId);
     if (collection != null)
     {
         var request = new Request<Collection>("collection/" + collectionId);
         collection = await request.ProcesRequestAsync();
         DatabaseCache.SetObject(collectionId, collection);
     }
     return collection;
 }
开发者ID:Fishes,项目名称:TMDbWrapper,代码行数:16,代码来源:TheMovieDbCollection.cs

示例11: GetPersonAsync

 /// <summary>
 /// Gets the information of the specified person.
 /// </summary>
 /// <param name="PersonID">The id of the person.</param>
 /// <param name="extras">Indicates which parts should be prefetched.</param>
 /// <returns>The person.</returns>
 public static async Task<Person> GetPersonAsync(int PersonID, PersonExtras extras = 0)
 {
     Person result = DatabaseCache.GetObject<Person>(PersonID);
     if (result == null)
     {
         Request<Person> request = new Request<Person>("person/" + PersonID.ToString());
         if (extras != 0)
         {
             request.AddParameter("append_to_response", extras.ToString().Replace(" ", ""));
         }
         result = await request.ProcesRequestAsync();
         DatabaseCache.SetObject(PersonID, result);
     }
     return result;
 }
开发者ID:ThadT,项目名称:TMDbWrapper,代码行数:21,代码来源:TheMovieDbPerson.cs

示例12: GetMovieAsync

 /// <summary>
 /// Gets a movie by the movie database id.
 /// </summary>
 /// <param name="movieId">Id of the movie</param>
 /// <param name="extra">Indicates which parts should be prefetched.</param>
 /// <returns>The specified movie.</returns>
 public static async Task<Movie> GetMovieAsync(int movieId, MovieExtras extra = 0)
 {
     var movie = DatabaseCache.GetObject<Movie>(movieId);
     if (movie == null)
     {
         var request = new Request<Movie>("movie/" + movieId);
         if (!string.IsNullOrEmpty(Language))
             request.AddParameter("language", Language);
         if (extra != 0)
         {
             request.AddParameter("append_to_response", extra.ToString().Replace(" ", ""));
         }
         movie = await request.ProcesRequestAsync();
         DatabaseCache.SetObject(movieId, movie);
     }
     return movie;
 }
开发者ID:Fishes,项目名称:TMDbWrapper,代码行数:23,代码来源:TheMovieDbMovie.cs

示例13: GetTvAsync

        /// <summary>
        /// Gets a TvSeries by the movie database id.
        /// </summary>
        /// <param name="tvSeriesId">The id of the tv series</param>
        /// <param name="extra">Indicates which parts should be prefetched.</param>
        /// <returns>The specified tv series</returns>
        public static async Task<TVSeries> GetTvAsync(int tvSeriesId, TVSeriesExtras extra = 0)
        {
            var tvSeries = DatabaseCache.GetObject<TVSeries>(tvSeriesId);

            if(tvSeries == null){
                var request = new Request<TVSeries>("tv/" + tvSeriesId);

                if (!string.IsNullOrEmpty(Language))
                    request.AddParameter("language", Language);
                if (extra != 0)
                {
                    request.AddParameter("append_to_response", extra.ToString().Replace(" ", ""));
                }
                tvSeries = await request.ProcesRequestAsync();
                DatabaseCache.SetObject(tvSeriesId, tvSeries);
            }
            return tvSeries;
        }
开发者ID:Fishes,项目名称:TMDbWrapper,代码行数:24,代码来源:TheMovieDbTv.cs

示例14: GetSeasonAsync

 /// <summary>
 /// Gets a season of a tv series by the database id of the series and the sequence number of the season.
 /// </summary>
 /// <param name="tvSeriesId">The if of the tv series.</param>
 /// <param name="seasonNumber">The sequence number of the season.</param>
 /// <returns>The season</returns>
 public static async Task<Season> GetSeasonAsync(int tvSeriesId, int seasonNumber)
 {
     Season season = null;
     var series = DatabaseCache.GetObject<TVSeries>(tvSeriesId);
     if (series != null)
     {
         var summary = series.SeasonSummaries.FirstOrDefault(s => s.SeasonNumber == seasonNumber);
         if(summary != null){
             season = DatabaseCache.GetObject<Season>(summary.Id);
         }
     }
     if (season == null)
     {
         var request = new Request<Season>("tv/" + tvSeriesId + "/season/" + seasonNumber);
         if (!string.IsNullOrEmpty(Language))
             request.AddParameter("language", Language);
         season = await request.ProcesRequestAsync();
         DatabaseCache.SetObject(season.Id, season);
     }
     return season;
 }
开发者ID:Fishes,项目名称:TMDbWrapper,代码行数:27,代码来源:TheMovieDbTv.cs

示例15: GetMovieImagesAsync

 /// <summary>
 /// All images of a specific movie.
 /// </summary>
 /// <param name="movieId">The id of the movie.</param>
 /// <returns>The images.</returns>
 public static async Task<Image> GetMovieImagesAsync(int movieId)
 {
     var images = DatabaseCache.GetObject<Image>(movieId);
     if (images == null)
     {
         var request = new Request<Image>("movie/" + movieId + "/images");
         if (!string.IsNullOrEmpty(Language))
             request.AddParameter("language", Language);
         images = await request.ProcesRequestAsync();
         DatabaseCache.SetObject(movieId, images);
     }
     return images;
 }        
开发者ID:Fishes,项目名称:TMDbWrapper,代码行数:18,代码来源:TheMovieDbMovie.cs


注:本文中的Request.ProcesRequestAsync方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。