コード例 #1
0
        //public override CommentInfo GetById(int id)
        //{
        //    string key = GetModelKey(id);
        //    Func<CommentInfo> GetEntity = () => GetFromDB(id);
        //    return RedisHelper.GetEntity<CommentInfo>(key, GetEntity);
        //}

        //public override IEnumerable<CommentInfo> GetByIds(IEnumerable<int> ids)
        //{
        //    foreach (int id in ids)
        //    {
        //        yield return GetById(id);
        //    }
        //}

        //public override CommentInfo GetFromDB(int id)
        //{
        //    return Context.CommentInfo.Find(id);
        //}

        public override string GetModelKey(int id)
        {
            return(RedisKeyHelper.GetCommentKey(id));
        }