public IActionResult GetReviewByFollowing(int id) { var following = _userRepository.GetFollowing(id); List <Review> followingReview = new List <Review>(); foreach (var item in following) { foreach (var item2 in _reviewRepository.GetByUserId(item.UserId)) { followingReview.Add(item2); } } followingReview.Sort((x, y) => DateTime.Compare(x.ReviewDate, y.ReviewDate)); //still working return(Ok(followingReview)); }