public async Task <SpeakerResponse> GetSpeakerById(int speakerId) { var speaker = await _repository.GetSpeakerById(speakerId); if (speaker == null) { return(null); } return(new SpeakerResponse(speaker)); }
private async Task <List <SpeakersUrlResponse> > GetSpeakers(string speakers) { List <SpeakersUrlResponse> speakersUrlResponses = new List <SpeakersUrlResponse>(); if (!string.IsNullOrEmpty(speakers)) { var speakersId = speakers.Split(','); if (speakersId != null) { foreach (var code in speakersId) { var s = await _speakerRepository.GetSpeakerById(int.Parse(code.Trim())); if (s != null) { speakersUrlResponses.Add(new SpeakersUrlResponse(s.Name, int.Parse(code.Trim()))); } } } } return(speakersUrlResponses); }
public IActionResult GetSpeakerById(int id) { SpeakerModel speaker = _speakerRepository.GetSpeakerById(id); return(Ok(speaker)); }
public async Task <Speaker> GetSpeakerById(int speakerId) { return(await _speakerRepository.GetSpeakerById(speakerId)); }