123456789101112131415161718192021222324252627282930313233343536 |
- using KC.Cache.Redis;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using Common;
- namespace KC.Cache
- {
- public class CacheFactory
- {
- /// <summary>
- /// 获取缓存对象
- /// </summary>
- /// <returns></returns>
- public static ICache GetCache(CacheType cacheType = CacheType.WebCacne)
- {
- switch (cacheType)
- {
- case CacheType.WebCacne:
- return new KC.Cache.WebCache.WebCache();
- case CacheType.RedisCache:
- return new RedisCache();
- };
- return RedisCache.GetRedisCache();
- }
- }
- public enum CacheType
- {
- WebCacne = 1,
- RedisCache = 2
- }
- }
|