public async Task <SpeakerViewModel> GetSpeakerAsync() { SpeakerViewModel speakerViewModel = new SpeakerViewModel(); try { Speaker speaker = await _speakerRepository.GetAsync(x => x.Id > 0); if (speaker != null) { speakerViewModel.FullName = speaker.FullName; speakerViewModel.PictureUrl = speaker.PictureURL; speakerViewModel.ShortAbstract = speaker.AchievementShort; } } catch (Exception ex) { //Add your logging code here. } return(speakerViewModel); }
public async Task <SpeakerDto> GetAsync(Guid speakerId) { var entity = await _speakerRepository.GetAsync(speakerId); return(entity?.AsDto()); }