using Hutopy.Application.AzureBlobStorage.Constants; using Hutopy.Application.Common.Interfaces; namespace Hutopy.Application.Users.Queries.GetCurrentUser; public record GetCurrentUserProfilePictureQuery : IRequest; public class GetCurrentUserProfilePictureQueryHandler( IIdentityService identityService, IBlobStorage blobStorage ) : IRequestHandler { public async Task Handle(GetCurrentUserProfilePictureQuery request, CancellationToken cancellationToken) { var identityUser = await identityService.GetCurrentUserAsync(); return await blobStorage.DownloadFileAsync( ContainerNames.Users, $"{identityUser.Id.ToString()}/{SubDirectoryNames.Profile}/{CommonFileNames.ProfilePicture}", cancellationToken); } }