Ejemplo n.º 1
0
        public static ContentRatingStats GetStats(Guid contentGuid)
        {
            ContentRatingStats stats = new ContentRatingStats();

            using (IDataReader reader = DBContentRating.GetStatsByContent(contentGuid))
            {
                if (reader.Read())
                {
                    stats.TotalVotes    = Convert.ToInt32(reader["TotalRatings"]);
                    stats.AverageRating = Convert.ToInt32(reader["CurrentRating"]);
                }
            }

            return(stats);
        }
Ejemplo n.º 2
0
        public static ContentRatingStats GetStats(Guid contentGuid)
        {
            ContentRatingStats stats = new ContentRatingStats();

            using(IDataReader reader = DBContentRating.GetStatsByContent(contentGuid))
            {
                if (reader.Read())
                {
                    stats.TotalVotes = Convert.ToInt32(reader["TotalRatings"]);
                    stats.AverageRating = Convert.ToInt32(reader["CurrentRating"]);
                }
            }

            return stats;
        }