Exemple #1
0
        public Tuple <Venue[], string> GetOrgEventVenues(int id)
        {
            var request  = NewRequestFactory.CreateOrgEventVenuesRequest(id);
            var response = GetResponse(request);
            var result   = default(Tuple <Venue[], string>);

            if (response != null)
            {
                var eventMetadata = response.Item1
                                    .GetRecords <EventMetadata>(0)
                                    .FirstOrDefault();

                var shows = response.Item1
                            .GetRecords <Show>(1)
                            .ToArray();

                var venueDetails = response.Item1
                                   .GetRecords <EventVenueDetail>(2)
                                   .ToArray();

                var venues = response.Item1
                             .GetRecords <Entity>(3)
                             .Select(e =>
                {
                    var venue = CreateVenue(e, venueDetails, shows);
                    return(venue);
                })
                             .ToArray();

                result = new Tuple <Venue[], string>(venues, response.Item2);
            }

            return(result);
        }
Exemple #2
0
        public Tuple <Org, string> GetHost(int id)
        {
            var request  = NewRequestFactory.CreateHostRequest(id);
            var response = GetResponse(request);
            var result   = default(Tuple <Org, string>);

            if (response != null && response.Item1.Selects != null)
            {
                var entity = response.Item1
                             .GetRecords <Entity>(0)
                             .FirstOrDefault();

                var eventMetadatas = response.Item1
                                     .GetRecords <EventMetadata>(1)
                                     .ToArray();

                if (entity != null)
                {
                    var org = CreateOrg(entity, eventMetadatas);
                    result = new Tuple <Org, string>(org, response.Item2);
                }
            }

            return(result);
        }
Exemple #3
0
        public Tuple <OrgEvent[], string> GetOrgEvents()
        {
            var request  = NewRequestFactory.CreateOrgEventsRequest();
            var response = GetResponse(request);
            var result   = default(Tuple <OrgEvent[], string>);

            if (response != null)
            {
                var eventMetadatas = response.Item1
                                     .GetRecords <EventMetadata>(0)
                                     .ToArray();

                var hosts = response.Item1
                            .GetRecords <Entity>(1)
                            .ToArray();

                var orgEvents = eventMetadatas
                                .Select(em =>
                                        new OrgEvent(em, hosts.First(h => h.Id == em.Host.Id())))
                                .ToArray();

                result = new Tuple <OrgEvent[], string>(orgEvents, response.Item2);
            }

            return(result);
        }
Exemple #4
0
        public Tuple <OrgEvent, string> GetOrgEventInfo(int id)
        {
            var request  = NewRequestFactory.CreateOrgEventInfoRequest(id);
            var response = GetResponse(request);
            var result   = default(Tuple <OrgEvent, string>);

            if (response != null)
            {
                var eventMetadata = response.Item1
                                    .GetRecords <EventMetadata>(0)
                                    .FirstOrDefault();

                var host = response.Item1
                           .GetRecords <Entity>(1)
                           .FirstOrDefault();

                var orgEvent = new OrgEvent(eventMetadata, host);

                result = new Tuple <OrgEvent, string>(orgEvent, response.Item2);
            }

            return(result);
        }