示例#1
0
        public async Task <ImageVm> GetSpeakerAvatarOrDefaultAsync(string speakerId, ImageSize size)
        {
            var speaker = await _speakerProvider.GetSpeakerOrDefaultAsync(speakerId).ConfigureAwait(false);

            if (speaker == null)
            {
                return(null);
            }

            var imageId = size == ImageSize.Full ? speaker.AvatarId : speaker.AvatarSmallId;

            var image = await _imageProvider.GetImageOrDefaultAsync(imageId);

            return(image?.ToVm());
        }
示例#2
0
        public async Task <SpeakerVm> GetSpeakerAsync(string speakerId)
        {
            var speaker = await _speakerProvider.GetSpeakerOrDefaultAsync(speakerId).ConfigureAwait(false);

            return(speaker.ToVm());
        }