public ActionResult <IEnumerable <TalkDto> > GetTalksForSpeaker(int speakerId) { if (!_speakerRepository.SpeakerExists(speakerId)) { return(NotFound()); } var talksForSpeaker = _talkRepository.GetTalks(speakerId).ToList(); return(Ok(_mapper.Map <IEnumerable <TalkDto> >(talksForSpeaker))); }
public IActionResult CheckIfSpeakerExists(int speakerId) { var speakerExists = speakerRepository.SpeakerExists(speakerId); if (speakerExists) { return(Ok()); } return(NoContent()); }