using CP.Cache;
using CP.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CP.Business
{
public class CzLinkBLL
{
///
/// 缓存
///
static WMCache cache = WMCache.GetCacheService();
///
/// 获取当前cid的超链接
///
///
public static List GetList(int cid)
{
string key = "CzLink_" + cid;
List list = cache.GetObject>(key);
if (list == null)
{
DataConnect dc = new DataConnect();
var listAll = cache.GetObject>("CzLink_All");
if (listAll == null)
{
listAll = dc.db.Fetch($" ORDER BY seq asc");
cache.AddObject("CzLink_All", listAll, (int)CacheTime.System);
}
list = listAll.Where(p => p.cid == cid).ToList();
cache.AddObject(key, list, (int)CacheTime.System);
}
return list;
}
}
}