public async Task <JObject> GetShows(long cinemaId, DateTime?date, GetShowsDynamicQuery dynamicQuery, CancellationToken cancellationToken) { if (cinemaId <= 0) { throw new ArgumentOutOfRangeException(nameof(cinemaId), $"{nameof(cinemaId)} needs to be bigger than 0"); } var query = new GetShowsQuery(cinemaId, date, dynamicQuery); var request = BuildRestRequest(query.BuildRequest()); var client = CreateClient(); var response = await client.ExecutePostTaskAsync <GraphQLResponse>(request, cancellationToken).ConfigureAwait(false); return(response?.Data?.Data); }
public async Task <IEnumerable <Show> > GetShows( long cinemaId, DateTime?date = null, GetShowsDynamicQuery dynamicQuery = GetShowsDynamicQuery.Full, CancellationToken cancellationToken = default(CancellationToken)) { var jsonResult = await m_client.GetShows(cinemaId, date, dynamicQuery, cancellationToken).ConfigureAwait(false); if (jsonResult == null) { return(new Show[0]); } return(m_jsonWorker.ConvertToShows(jsonResult)); }
public GetShowsQuery(long cinemaId, DateTime?date, GetShowsDynamicQuery dynamicQuery) { m_cinemaId = cinemaId; m_date = date; m_dynamicQuery = dynamicQuery; }