public static VoteResults GetVoteResults(string itemKey)
        {
            DatasetInfoDataSource datasetInfoDS = new DatasetInfoDataSource();

            AnalyticInfo dInfo = datasetInfoDS.GetAnalyticSummary(itemKey);

            return new VoteResults()
            {
                Positive = dInfo.PositiveVotes,
                Negative = dInfo.NegativeVotes,
            };
        }
        public static void AddVote(Rate item)
        {
            RateDataSource rateDS = new RateDataSource();
            DatasetInfoDataSource datasetInfoDS = new DatasetInfoDataSource();

            rateDS.AddVote(new RateEntry()
            {
                RowKey = Guid.NewGuid().ToString(),
                ItemKey = item.ItemKey,
                PartitionKey = "rates",
                RateDate = item.RateDate,
                RateValue = item.RateValue,
                User = item.User,
            });

            datasetInfoDS.IncrementVote(item.ItemKey, item.RateValue);
        }
        public static void RegisterView(String itemKey, String url, String user)
        {
            DatasetInfoDataSource datasetInfoDataSource = new DatasetInfoDataSource();
            ViewDataSource viewDS = new ViewDataSource();

            datasetInfoDataSource.IncrementView(itemKey);

            // No logging if analytics are disabled
            if (OgdiConfiguration.GetValue("IsAnalytics") == "0") return;

            viewDS.AddView(new ViewEntry()
            {
                Date = DateTime.Now,
                ItemKey = itemKey,
                User = user,
                RequestedUrl = url,
            });
        }
 //CETTE METHODE NE SERT A RIEN
 public static void IncrementView(String itemKey)
 {
     DatasetInfoDataSource datasetInfoDS = new DatasetInfoDataSource();
     datasetInfoDS.IncrementView(itemKey);
 }