Example #1
0
        public async Task <TalkDetail> GetTalkDetail(string id)
        {
            var detail = Talks.Select(MapTalkToDetail).FirstOrDefault(t => t.Id == id);

            detail.SpeakerTalks = await GetOtherTalksBySpeaker(id);

            return(detail);
        }
Example #2
0
        public Task <Talk> CreateTalk(NewTalk talk)
        {
            var newTalk = new Talk()
            {
                Id          = "Talks/" + (Talks.Select(t => int.Parse(DocumentId.NoPrefix(t.Id))).Max() + 1),
                Headline    = talk.Headline,
                Description = talk.Description,
                Speaker     = talk.Speaker
            };

            Talks = new List <Talk>(Talks)
            {
                newTalk
            };

            return(Task.FromResult(newTalk));
        }