Exemple #1
0
        public async Task <IActionResult> MutualFollowingsAsync()
        {
            // when the user also follows the follower, "Mutual"
            int userId = Convert.ToInt32(User.FindFirstValue(ClaimTypes.NameIdentifier));
            IEnumerable <FollowerDto> followers = await _followerService.GetMutualFollowersByUserIdAsync(userId);

            return(View("Mutuals", new MutualsViewModel(followers)));
        }
Exemple #2
0
        public async Task UpdateTempDataAsync(ITempDataDictionary tempData, int userId)
        {
            IEnumerable <ShareCollectionDto> collectionDTOs = (await _collectionService.GetMyCollectionsAsync(userId))
                                                              .Select(collection => new ShareCollectionDto {
                Name = collection.Name, Id = collection.Id
            });
            IEnumerable <FollowerDto> mutualFollowingsDTOs = await _followerService.GetMutualFollowersByUserIdAsync(userId);

            tempData["collections"] = JsonConvert.SerializeObject(collectionDTOs.ToList());
            tempData.Keep("collections");
            tempData["mutualFollowings"] = JsonConvert.SerializeObject(mutualFollowingsDTOs.ToList());
            tempData.Keep("mutualFollowings");
        }