public static async Task <IReadOnlyCollection <RestTopCommunity> > GetTopCommunitiesAsync(BaseRestClient client, uint limit) { var token = TokenHelper.GetSingleToken(client); var model = await client.RestClient.GetTopCommunitiesInternalAsync(token, limit); var entity = model.Communities.Select(x => RestTopCommunity.Create(client, x)); return(entity.ToArray()); }
public static async Task <IReadOnlyCollection <RestTopCommunity> > GetTopCommunitiesAsync(BaseTwitchClient client, PageOptions paging = null, RequestOptions options = null) { var model = await client.ApiClient.GetTopCommunitiesAsync(paging, options).ConfigureAwait(false); if (model.Communities != null) { return(model.Communities.Select(x => RestTopCommunity.Create(client, x)).ToArray()); } return(null); }