1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using LeaRun.Application.Busines.PipeNetworkManage;
- using LeaRun.Cache.Factory;
- using LeaRun.Application.Entity.PipeNetworkManage;
- namespace LeaRun.Application.Cache
- {
- /// <summary>
- /// 设备信息缓存
- /// </summary>
- public class MeterListCache
- {
- private MeterBLL meterBll = new MeterBLL();
- /// <summary>
- /// 设备信息
- /// </summary>
- /// <returns></returns>
- public IEnumerable<MeterEntity> GetMeterList()
- {
- var cacheList = CacheFactory.Cache().GetCache<IEnumerable<MeterEntity>>(meterBll.cacheKey);
- if (cacheList == null)
- {
- var data = meterBll.GetMeters();
- CacheFactory.Cache().WriteCache(data, meterBll.cacheKey);
- return data;
- }
- else
- {
- return cacheList;
- }
- }
- }
- }
|