Example #1
0
        public static IJITCache2 CreateCache()
        {
            var    type = ConfigurationManager.AppSettings["CacheType"];
            string str  = ConfigurationManager.AppSettings["CacheServers"];

            string[] serverlist;
            if (string.IsNullOrEmpty(str))
            {
                serverlist = new string[] { };
            }
            else
            {
                serverlist = str.Split(',');
            }
            switch (type)
            {
            case "0":
                return(JITMemoryCache.GetInstance());

            case "1":
                return(JITDistributedCache.GetInstance(serverlist));

            default:
                return(JITMemoryCache.GetInstance());
            }
        }
Example #2
0
 public static JITMemoryCache GetInstance()
 {
     if (_default != null)
     {
         return(_default);
     }
     else
     {
         return(_default = new JITMemoryCache());
     }
 }