Beispiel #1
0
        public long GetDiaryViewsCount(long diaryId)
        {
            DiaryViewKey key        = CacheContextKeyBuilder.BuildDiaryViewKey(diaryId);
            double?      viewsCount = TripMeCacheContext.Context().SortedSetScore(key.sortedSetKey, key.memberKey);

            if (!viewsCount.HasValue)
            {
                return(0);
            }

            return((long)viewsCount.Value);
        }
Beispiel #2
0
        public void IncrementDiaryViews(long diaryId)
        {
            DiaryViewKey key = CacheContextKeyBuilder.BuildDiaryViewKey(diaryId);

            TripMeCacheContext.Context().SortedSetIncrement(key.sortedSetKey, key.memberKey, 1);
        }