예제 #1
0
 /// <summary>
 /// 获取指定标签
 /// 不存在或已删除时返回null
 /// </summary>
 /// <param name="tagId">标签Id</param>
 /// <returns></returns>
 public virtual Database.GenericTag GetTag(long tagId)
 {
     return(TagCache.GetOrCreate(tagId, () =>
                                 UnitOfWork.ReadData <Database.GenericTag, Database.GenericTag>(r => {
         return r.GetByIdWhereNotDeleted(tagId);
     }), TagCacheTime));
 }
예제 #2
0
 /// <summary>
 /// 获取指定标签,不存在或已删除时返回null
 /// </summary>
 /// <param name="tagId">标签Id</param>
 /// <returns></returns>
 public virtual Entities.GenericTag GetWithCache(Guid tagId)
 {
     return(TagCache.GetOrCreate(tagId, () => Get(tagId), TagCacheTime));
 }