public async Task <GetProfileResponse> Handle(GetProfileRequest request, CancellationToken cancellationToken)
        {
            var user = await _userAccountRepository.GetUserAccountAsync(request.User);

            var userFeeds = await _userFeedRepository.GetAsync(user);

            var apiAccesses = await _userAccountApiAccessRepository.GetAsync(user);

            var externalApiAccessModels = new List <ExternalApiAccessModel>();

            foreach (var apiAccess in apiAccesses)
            {
                var mostRecentToken = await _userAccountTokenRepository.GetLatestAsync(apiAccess);

                var lastAccessed = mostRecentToken?.CreatedDateTime ?? apiAccess.CreatedDateTime;
                externalApiAccessModels.Add(new ExternalApiAccessModel(apiAccess.UserAccountApiAccessId, apiAccess.ApiClient.DisplayName, apiAccess.CreatedDateTime, lastAccessed, apiAccess.RevokedDateTime));
            }

            var externalApiClients = await _apiClientRepository.GetAsync(user);

            return(new GetProfileResponse(
                       userFeeds.Select(uf => new FeedModel(uf.UserFeedId, uf.UserFeedIdentifier, uf.CreatedDateTime, uf.FeedType, uf.ItemDisplay)),
                       externalApiAccessModels.OrderByDescending(a => a.RevokedDateTime ?? DateTime.MaxValue).ThenByDescending(a => a.LastAccessedDateTime),
                       externalApiClients.OrderBy(a => a.DisplayName).Select(a => new ExternalApiClientModel(
                                                                                 a.ApiClientId, a.DisplayName, a.AppKey, a.RedirectUri, a.IsEnabled
                                                                                 ))));
        }
        public async Task <bool> Handle(DeleteFeedRequest request, CancellationToken cancellationToken)
        {
            var user = await _userAccountRepository.GetUserAccountAsync(request.User);

            var userFeed = await _userFeedRepository.GetAsync(request.UserFeedId);

            if (userFeed == null || userFeed.UserAccountId != user.UserAccountId)
            {
                return(false);
            }

            userFeed.DeletedDateTime = DateTime.UtcNow;
            await _userFeedRepository.SaveAsync(userFeed);

            return(true);
        }