示例#1
0
        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,
            });
        }
示例#2
0
 private bool RankingEntryHasRatings(RankingEntry entry)
 {
     return(entry.Ratings.Any(rating => rating.HasValue) || !string.IsNullOrWhiteSpace(entry.Comment));
 }