public async Task <IActionResult> Popular()
        {
            logger.LogInformation($"{nameof(Popular)}()");
            IEnumerable <PhotoModel> popularPhotos = await photosService.GetPopularPhotos(GetCurrentUserId());

            return(View(popularPhotos));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Index()
        {
            var latestPhotos = await photosService.GetPopularPhotos(GetCurrentUserId());

            var likedPhotos = latestPhotos.Where(x => x.PhotoIsLikedByCurrentUser);

            if (likedPhotos.Any())
            {
                logWriter.LogInformation($"User likes photos {string.Join(", ", likedPhotos.Select(x => x.PhotoId.ToDbValue()))}");
            }
            return(View(latestPhotos.Select(photoModelConverter.ToPublic).ToArray()));
        }