コード例 #1
0
ファイル: ClientHelper.cs プロジェクト: kouweizhong/NTwitch
        public static async Task <IReadOnlyCollection <RestGame> > FindGamesAsync(BaseTwitchClient client, string query, bool islive, RequestOptions options = null)
        {
            var model = await client.ApiClient.FindGamesAsync(query, islive, options).ConfigureAwait(false);

            if (model.Games != null)
            {
                return(model.Games.Select(x => RestGame.Create(client, x)).ToArray());
            }
            return(null);
        }
コード例 #2
0
        internal static async Task <IReadOnlyCollection <RestGame> > SearchGamesAsync(BaseRestClient client, string query, bool islive)
        {
            var token = TokenHelper.GetSingleToken(client);
            var model = await client.RestClient.SearchGamesInternalAsync(token, query, islive);

            if (model == null)
            {
                return(new List <RestGame>());
            }

            var entity = model.Games.Select(x => RestGame.Create(client, x));

            return(entity.ToArray());
        }