예제 #1
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);
        }
예제 #2
0
 public int Save()
 {
     return(repo.Save());
 }