コード例 #1
0
ファイル: RestGame.cs プロジェクト: kouweizhong/NTwitch
        internal static RestGame Create(BaseTwitchClient client, Model model)
        {
            var entity = new RestGame(client, model.Id);

            entity.Update(model);
            return(entity);
        }
コード例 #2
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);
        }
コード例 #3
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());
        }
コード例 #4
0
ファイル: RestGame.cs プロジェクト: kouweizhong/NTwitch
 public int GetHashCode(RestGame obj)
 => obj.GetHashCode();
コード例 #5
0
ファイル: RestGame.cs プロジェクト: kouweizhong/NTwitch
 public bool Equals(RestGame x, RestGame y)
 => x.Id == y.Id;