Exemplo n.º 1
0
        public async Task <ActionResult> SpeakerDetails(string speakerName)
        {
            if (speakerName.EndsWith("tein"))
            {
                var throwingTask = Task.Factory.StartNew(ThrowProhibitedSurnameException);
                // The exception is rethrown here, but the source is on another thread.
                throwingTask.Wait();
            }
            var speaker = await _conferenceService.GetSpeakerByName(speakerName);

            var speakerPhoto = await _conferenceService.GetSpeakerPhoto(speakerName);

            HttpContext.Cache.Insert(Guid.NewGuid().ToString(), speakerPhoto);
            return(View(speaker));
        }