Shuxia Ning
2024-08-06 1d5b344c8be498c9989f3fe2e9846b1dcc919cb8
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
namespace IStation.Service
{
    /// <summary>
    /// 
    /// </summary>
    public partial class AnalysisCombine
    {
 
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        private static Dictionary<string, List<Model.AnalysisCombine>> GetDictCache()
        {
            return AnalysisCombineCacheHelper.GetSet(() =>
            {
                var dal = DALCreateHelper.CreateDAL<IStation.DAL.IAnalysisCombine>();
                var entity_dict = dal.GetAllTable();
                if (entity_dict == null || !entity_dict.Any())
                {
                    return new Dictionary<string, List<Model.AnalysisCombine>>();
                }
 
                var model_dict = new Dictionary<string, List<Model.AnalysisCombine>>();
                for (int i = 0; i < entity_dict.Count; i++)
                {
                    var entity_item = entity_dict.ElementAt(i);
                    model_dict[entity_item.Key] = Entity2Models(entity_item.Value);
                }
                return model_dict;
            }, ConfigHelper.CacheKeepTime, ConfigHelper.CacheRandomTime);
        }
 
    }
}