public async Task <IActionResult> Popular() { logger.LogInformation($"{nameof(Popular)}()"); IEnumerable <PhotoModel> popularPhotos = await photosService.GetPopularPhotos(GetCurrentUserId()); return(View(popularPhotos)); }
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())); }