移动系统liao
2024-07-30 35a617123c0d578772d9f4450bf27d3b52277384
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/***********************************************************************
 *            Project: baifenBinfa.Net                                     *
 *                Web: https://baifenBinfa.com                             *
 *        ProjectName: 百分兵法管理系统                               *
 *             Author:                                        *
 *              Email:                               *
 *           Versions: 1.0                                             *
 *         CreateTime: 2020-02-02 14:43:16
 *          NameSpace: CoreCms.Net.Framework.Caching
 *           FileName: DataCache
 *   ClassDescription: 
 ***********************************************************************/
 
 
using CoreCms.Net.Caching.MemoryCache;
using CoreCms.Net.Caching.Redis;
using CoreCms.Net.Configuration;
using CoreCms.Net.Utility.Extensions;
 
namespace CoreCms.Net.Caching.Manual
{
    /// <summary>
    /// 手动缓存调用
    /// </summary>
    public static partial class ManualDataCache
    {
        private static IManualCacheManager _instance = null;
        /// <summary>
        /// 静态实例,外部可直接调用
        /// </summary>
        public static IManualCacheManager Instance
        {
            get
            {
                if (_instance == null)
                {
                    if (AppSettingsConstVars.RedisUseCache)
                    {
                        _instance = new RedisCacheManager();
                    }
                    else
                    {
                        _instance = new MemoryCacheManager();
 
                    }
                }
                return _instance;
            }
        }
    }
}