internal static RestGame Create(BaseTwitchClient client, Model model) { var entity = new RestGame(client, model.Id); entity.Update(model); return(entity); }
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); }
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()); }
public int GetHashCode(RestGame obj) => obj.GetHashCode();
public bool Equals(RestGame x, RestGame y) => x.Id == y.Id;