private EntryRatingsInfo MapRankingEntryToRatingsInfo(RankingEntry entry) { var ratings = entry.Ratings .Where(rating => rating.HasValue) .Select(rating => new RatingInfo { Id = rating.Id, Value = rating.Value }) .ToList(); var comment = !string.IsNullOrWhiteSpace(entry.Comment) ? entry.Comment : null; return(new EntryRatingsInfo { EntryId = entry.JamEntry.Id, Ratings = ratings, Comment = comment, }); }
private bool RankingEntryHasRatings(RankingEntry entry) { return(entry.Ratings.Any(rating => rating.HasValue) || !string.IsNullOrWhiteSpace(entry.Comment)); }