Ejemplo n.º 1
0
        public static int CommentCount(int submissionID)
        {
            string cacheKey = CachingKey.CommentCount(submissionID);
            var    data     = CacheHandler.Instance.Register(cacheKey, new Func <int?>(() =>
            {
                using (var repo = new Repository())
                {
                    return(repo.GetCommentCount(submissionID));
                }
            }), _cacheTime, 3);

            return(data.Value);
        }