コード例 #1
0
        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)));
        }
コード例 #2
0
        public IActionResult CheckIfSpeakerExists(int speakerId)
        {
            var speakerExists = speakerRepository.SpeakerExists(speakerId);

            if (speakerExists)
            {
                return(Ok());
            }

            return(NoContent());
        }