Esempio n. 1
0
 /// <summary>
 /// Asynchronously gets the entity IDs with specified sequence of titles on the specified site.
 /// </summary>
 /// <param name="site">The Wikibase repository site.</param>
 /// <param name="siteName">The site name of the sitelinks.</param>
 /// <param name="titles">The article titles on the site <paramref name="siteName"/> to check for entity IDs.</param>
 /// <exception cref="ArgumentNullException">Either <paramref name="site"/>, <paramref name="siteName"/>, or <paramref name="titles"/> is <c>null</c>.</exception>
 /// <returns>
 /// A asynchronous sequence of entity IDs in the identical order with <paramref name="titles"/>.
 /// If one or more entities are missing, the corresponding entity ID will be <c>null</c>.
 /// </returns>
 public static IAsyncEnumerable <string> IdsFromSiteLinksAsync(WikiSite site, string siteName, IEnumerable <string> titles)
 {
     if (site == null)
     {
         throw new ArgumentNullException(nameof(site));
     }
     if (siteName == null)
     {
         throw new ArgumentNullException(nameof(siteName));
     }
     if (titles == null)
     {
         throw new ArgumentNullException(nameof(titles));
     }
     return(WikibaseRequestHelper.EntityIdsFromSiteLinksAsync(site, siteName, titles));
 }
Esempio n. 2
0
 /// <summary>
 /// Refreshes the entity information from Wikibase site.
 /// </summary>
 /// <param name="options">The options, including choosing the fields to fetch</param>
 /// <param name="languages">
 /// Filter down the internationalized values to the specified one or more language codes.
 /// Set to <c>null</c> for all available languages.
 /// </param>
 /// <param name="cancellationToken">The token used to cancel the operation.</param>
 /// <seealso cref="EntityExtensions.RefreshAsync(IEnumerable{Entity},EntityQueryOptions,ICollection{string},CancellationToken)"/>
 public Task RefreshAsync(EntityQueryOptions options, ICollection <string> languages, CancellationToken cancellationToken)
 {
     return(WikibaseRequestHelper.RefreshEntitiesAsync(new[] { this }, options, languages, cancellationToken));
 }
 /// <summary>
 /// Asynchronously fetch information for a sequence of entities.
 /// </summary>
 /// <param name="entities">A sequence of entities to be refreshed.</param>
 /// <param name="options">Provides options when performing the query.</param>
 /// <param name="languages">
 /// Filter down the internationalized values to the specified one or more language codes.
 /// Set to <c>null</c> to fetch for all available languages.
 /// </param>
 /// <param name="cancellationToken">The token used to cancel the operation.</param>
 /// <seealso cref="Entity.RefreshAsync()"/>
 public static Task RefreshAsync(this IEnumerable <Entity> entities, EntityQueryOptions options,
                                 ICollection <string> languages, CancellationToken cancellationToken)
 {
     return(WikibaseRequestHelper.RefreshEntitiesAsync(entities, options, languages, cancellationToken));
 }