public static string Update(int conferenceId, Models.Session session)
            {
                var request = Client.CreateEventsXdRequest($"api/ConferenceInfo/{conferenceId}/session/{session.Id}", Method.PUT);

                request.AddJsonBody(session);

                return(Client.Execute(request)?.Content);
            }
        private static void ImportSessions(int eventsXdConferenceId, int sessionizeConferenceId, SessionizeData sessionizeData)
        {
            var timeslots           = EventsXdService.SessionTimes.GetAll(eventsXdConferenceId).FromJson <IList <Timeslot> >().ToList();
            var rooms               = EventsXdService.Rooms.GetAll(eventsXdConferenceId).FromJson <IList <Models.Room> >().ToList();
            var levels              = EventsXdService.Levels.GetAll(eventsXdConferenceId).FromJson <IList <Level> >().ToList();
            var sessionTypes        = EventsXdService.SessionTypes.GetAll(eventsXdConferenceId).FromJson <IList <SessionType> >().ToList();
            var speakers            = EventsXdService.ConferenceSpeakers.GetAll(eventsXdConferenceId).FromJson <IList <ConferenceSpeaker> >().ToList();
            var tags                = EventsXdService.Tags.GetAll(eventsXdConferenceId).FromJson <IList <Tag> >().ToList();
            var tracks              = EventsXdService.Tracks.GetAll(eventsXdConferenceId).FromJson <IList <Tag> >().ToList();
            var workshopTrackId     = tracks.FirstOrDefault(x => x.Name == "Workshops")?.Id;
            var audiences           = EventsXdService.Audiences.GetAll(eventsXdConferenceId).FromJson <IList <Tag> >().ToList();
            var allAccessAudienceId = audiences.FirstOrDefault(x => x.Name == "All Access")?.Id;

            var sessions = sessionizeData.Sessions
                           //.Where(x => x.CategoryItems.Contains(sessionizeConferenceId))
                           //.Where(x => x.Id == "21437")
                           .ToList();

            var sessionizeSessionTypes = sessionizeData.Categories.Where(x => x.Title == "Session format").SelectMany(x => x.Items).ToList();
            var sessionizeTags         = sessionizeData.Categories.Where(x => x.Title == "Tags").SelectMany(x => x.Items).ToList();
            var sessionizeLevels       = sessionizeData.Categories.Where(x => x.Title == "Level").SelectMany(x => x.Items).ToList();
            var sessionizeRooms        = sessionizeData.Rooms.ToList();
            var sessionizeConferences  = sessionizeData.Categories.Where(x => x.Title == "Conference").SelectMany(x => x.Items).ToList();

            var sessionizeSpeakers = (
                from speaker in sessionizeData.Speakers
                let sessionsForSpeaker = sessions.Any(x => x.Speakers.Contains(speaker.Id))
                                         where sessionsForSpeaker
                                         select speaker
                ).ToList();

            foreach (var session in sessions)
            {
                var timeslotId = timeslots.FirstOrDefault(x => x.StartTime == DateTime.Parse(session.StartsAt))?.Id;

                var sessionizeLocation = sessionizeRooms.FirstOrDefault(x => x.Id == session.RoomId);
                var locationId         = rooms.FirstOrDefault(x => x.Name == sessionizeLocation?.Name)?.Id;

                var sessionizeLevel = sessionizeLevels.FirstOrDefault(x => session.CategoryItems.Contains(x.Id));
                var levelId         = levels.FirstOrDefault(x => x.Name == sessionizeLevel?.Name)?.Id;

                var sessionizeSessionType = sessionizeSessionTypes.FirstOrDefault(x => session.CategoryItems.Contains(x.Id));
                var sessionTypeId         = sessionTypes.FirstOrDefault(x => x.Name == sessionizeSessionType?.Name)?.Id;

                var sessionizeSpeakersNames = sessionizeSpeakers.Where(x => session.Speakers.Contains(x.Id)).Select(x => x.FullName).ToList();
                var speakerIds = speakers.Where(x => sessionizeSpeakersNames.Contains(x.FullName)).Select(x => x.Id).ToList();

                var sessionizeTagsNames = sessionizeTags.Where(x => session.CategoryItems.Contains(x.Id)).Select(x => x.Name).ToList();
                var tagIds = tags.Where(x => sessionizeTagsNames.Contains(x.Name)).Select(x => x.Id).ToList();

                var conference = sessionizeConferences.FirstOrDefault(x => session.CategoryItems.Contains(x.Id));

                var trackIds = new List <string>
                {
                    tracks.FirstOrDefault(x => x.Name == conference?.Name)?.Id
                };

                var addWorkshopTrack = sessionTypes.Any(x => x.Id == sessionTypeId && x.Name == "Workshops");
                if (addWorkshopTrack)
                {
                    trackIds.Add(workshopTrackId);
                }

                var audienceIds = new List <string>
                {
                    audiences.FirstOrDefault(x => x.Name == conference?.Name)?.Id,
                    allAccessAudienceId
                };

                var newSession = new Models.Session
                {
                    Name             = session.Title,
                    Description      = session.Description,
                    TimeslotId       = timeslotId,
                    LocationId       = locationId,
                    LevelId          = levelId,
                    IsSponsorSession = false,
                    SessionTypeId    = sessionTypeId,
                    SpeakerIds       = speakerIds,
                    TrackIds         = trackIds,
                    AudienceIds      = audienceIds,
                    TagIds           = tagIds
                };

                EventsXdService.Sessions.Add(eventsXdConferenceId, newSession);

                Console.WriteLine($"Imported {newSession.Name}");
            }
        }