Beispiel #1
0
 public bool Create(string key, T val, DateTime expire)
 {
     try
     {
         //设置缓存
         return(CacheContext.Set <T>(key, val, expire));
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Beispiel #2
0
 public bool Create(string key, T val, DateTime expire)
 {
     //设置缓存
     return(CacheContext.Set <T>(key, val, expire));
 }
Beispiel #3
0
 /// <summary>
 /// 获取缓存项
 /// </summary>
 /// <typeparam name="T">缓存对象类型</typeparam>
 /// <param name="key">键</param>
 /// <returns>缓存对象</returns>
 public bool CreateCache(string key, T entity, DateTime expire)
 {
     return(CacheContext.Set <T>(key, entity, expire));
 }