public SpeakerService(string speakerId)
        {
            CloudStorageAccount storageAccount = CloudStorageAccount.Parse(ConfigurationManager.ConnectionStrings["pocketDDDCloudStorage"].ConnectionString);
            this.tableClient = storageAccount.CreateCloudTableClient();
            this.userCommentsTable = tableClient.GetTableReference("Comments");
            this.userSessionDataTable = tableClient.GetTableReference("UserSessionData");
            var speakerLookupService = new SpeakerLookupService();
            this.speakerMapping = speakerLookupService.GetSpeakerMapping(speakerId);

            if (this.speakerMapping == null)
                throw new ApplicationException("Invalid speakerId");
        }
        public SpeakerService(string speakerId)
        {
            CloudStorageAccount storageAccount = CloudStorageAccount.Parse(ConfigurationManager.ConnectionStrings["pocketDDDCloudStorage"].ConnectionString);

            this.tableClient          = storageAccount.CreateCloudTableClient();
            this.userCommentsTable    = tableClient.GetTableReference("Comments");
            this.userSessionDataTable = tableClient.GetTableReference("UserSessionData");
            var speakerLookupService = new SpeakerLookupService();

            this.speakerMapping = speakerLookupService.GetSpeakerMapping(speakerId);

            if (this.speakerMapping == null)
            {
                throw new ApplicationException("Invalid speakerId");
            }
        }
        public IList <SpeakerMappingInfo> GenerateSpeakerMappings()
        {
            var speakerService = new SpeakerLookupService();
            var eventService   = new EventsService();

            var mappings     = speakerService.GenerateMappings(eventId, eventAdminToken);
            var dddEvent     = eventService.GetServerEventData(eventId);
            var eventDetails = eventService.GetEventDetail(dddEvent);

            var mappingInfo = mappings.Select(x => new SpeakerMappingInfo
            {
                EventId      = eventId,
                SessionId    = x.SessionId,
                SpeakerToken = x.RowKey,
                SpeakerName  = eventDetails.Sessions.Single(s => s.Id == x.SessionId).Speaker,
                URL          = ""
            }).ToList();

            return(mappingInfo);
        }
        public IList<SpeakerMappingInfo> GenerateSpeakerMappings()
        {
            var speakerService = new SpeakerLookupService();
            var eventService = new EventsService();

            var mappings = speakerService.GenerateMappings(eventId, eventAdminToken);
            var dddEvent = eventService.GetServerEventData(eventId);
            var eventDetails = eventService.GetEventDetail(dddEvent);

            var mappingInfo = mappings.Select(x => new SpeakerMappingInfo
            {
                EventId = eventId,
                SessionId = x.SessionId,
                SpeakerToken = x.RowKey,
                SpeakerName = eventDetails.Sessions.Single(s => s.Id == x.SessionId).Speaker,
                URL = ""
            }).ToList();

            return mappingInfo;
        }