Beispiel #1
0
        private async Task SetSpeakersId(List <string> speakersList, Talk talk)
        {
            StringBuilder spIds = new StringBuilder();

            foreach (var sName in speakersList)
            {
                var speaker = await _speakerRepository.GetSpeakerByName(sName);

                if (speaker != null)
                {
                    talk.AddSpeaker(speaker.Id);
                }
            }
        }
Beispiel #2
0
        public async Task AddSpeakers(List <SpeakerRequest> speakersRequest)
        {
            List <Speaker> speakers = new List <Speaker>();

            foreach (var s in speakersRequest)
            {
                var speaker = new Speaker(s.Id, s.Title, s.Linkedin, s.Twitter, s.Site, s.Photo, s.Biography);

                var existingSpeaker = await _repository.GetSpeakerByName(speaker.Name);

                if (existingSpeaker == null)
                {
                    speakers.Add(speaker);
                }
            }

            await _repository.Save(speakers);
        }
        public IActionResult GetSpeakerByName(string fname, string lname)
        {
            SpeakerModel speaker = _speakerRepository.GetSpeakerByName(fname, lname);

            return(Ok(speaker));
        }