コード例 #1
0
ファイル: VlogService.cs プロジェクト: Laixer/Swabbr-Backend
        /// <summary>
        ///     Gets a vlog wrapper from our data store.
        /// </summary>
        /// <param name="id">The vlog id.</param>
        /// <returns>The vlog.</returns>
        public async Task <VlogWrapper> GetWrapperAsync(Guid id)
        {
            var vlogWrapper = await _vlogRepository.GetWrapperAsync(id);

            vlogWrapper.Vlog.ThumbnailUri = await _entityStorageUriService.GetVlogThumbnailAccessUriAsync(vlogWrapper.Vlog.Id);

            vlogWrapper.Vlog.VideoUri = await _entityStorageUriService.GetVlogVideoAccessUriAsync(vlogWrapper.Vlog.Id);

            vlogWrapper.User.ProfileImageUri = await _entityStorageUriService.GetUserProfileImageAccessUriOrNullAsync(vlogWrapper.User);

            return(vlogWrapper);
        }
コード例 #2
0
        /// <summary>
        ///     Get a reaction wrapper from our data store.
        /// </summary>
        /// <param name="id">Reaction id.</param>
        /// <returns>Reaction wrapper.</returns>
        public async Task <ReactionWrapper> GetWrapperAsync(Guid id)
        {
            var reactionWrapper = await _reactionRepository.GetWrapperAsync(id);

            reactionWrapper.Reaction.ThumbnailUri = await _entityStorageUriService.GetReactionThumbnailAccessUriAsync(reactionWrapper.Reaction.Id);

            reactionWrapper.Reaction.VideoUri = await _entityStorageUriService.GetReactionVideoAccessUriAsync(reactionWrapper.Reaction.Id);

            reactionWrapper.User.ProfileImageUri = await _entityStorageUriService.GetUserProfileImageAccessUriOrNullAsync(reactionWrapper.User);

            return(reactionWrapper);
        }
コード例 #3
0
ファイル: UserService.cs プロジェクト: Laixer/Swabbr-Backend
        /// <summary>
        ///     Get a single user from our data store.
        /// </summary>
        /// <param name="userId">The user id.</param>
        /// <returns>The user.</returns>
        public async Task <User> GetAsync(Guid userId)
        {
            var user = await _userRepository.GetAsync(userId);

            user.ProfileImageUri = await _entityStorageUriService.GetUserProfileImageAccessUriOrNullAsync(user);

            return(user);
        }