lixiaojun
2023-04-12 fc6b7c9852f18e42fb9bccaf0cc22fbe5389d179
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;
 
namespace IStation.Application
{
    /// <summary>
    /// 缓存辅助类
    /// </summary>
    public class CacheHelper
    {
        /// <summary>
        /// 一级缓存
        /// </summary>
        public static int CacheLevel1
        {
            get
            {
                if (_cachelevel1 == null)
                {
                    _cachelevel1 = Settings.MemoryCache.Level1;
                }
                return _cachelevel1.Value;
            }
        }
        private static int? _cachelevel1;
 
        /// <summary>
        /// 二级缓存
        /// </summary>
        public static int CacheLevel2
        {
            get
            {
                if (_cachelevel2 == null)
                {
                    _cachelevel2 = Settings.MemoryCache.Level2;
                }
                return _cachelevel2.Value;
            }
        }
        private static int? _cachelevel2;
 
        /// <summary>
        /// 三级缓存
        /// </summary>
        public static int CacheLevel3
        {
            get
            {
                if (_cachelevel3 == null)
                {
                    _cachelevel3 = Settings.MemoryCache.Level3;
                }
                return _cachelevel3.Value;
            }
        }
        private static int? _cachelevel3;
 
        /// <summary>
        /// 四级缓存
        /// </summary>
        public static int CacheLevel4
        {
            get
            {
                if (_cachelevel4 == null)
                {
                    _cachelevel4 = Settings.MemoryCache.Level4;
                }
                return _cachelevel4.Value;
            }
        }
        private static int? _cachelevel4;
 
        /// <summary>
        /// 五级缓存
        /// </summary>
        public static int CacheLevel5
        {
            get
            {
                if (_cachelevel5 == null)
                {
                    _cachelevel5 = Settings.MemoryCache.Level5;
                }
                return _cachelevel5.Value;
            }
        }
        private static int? _cachelevel5;
 
 
    }
}