获取缓存
string CacheKey = "BrandsModel-" + BrandId;
object objModel = Maticsoft.Common.DataCache.GetCache(CacheKey);
if (objModel == null)
{
try
{
objModel = dal.GetModel(BrandId);
if (objModel != null)//
{
int ModelCache = Globals.SafeInt(BLL.SysManage.ConfigSystem.GetValueByCache("ModelCache"), 30);
Maticsoft.Common.DataCache.SetCache(CacheKey, objModel, DateTime.Now.AddMinutes(ModelCache), TimeSpan.Zero);//如果无法通过缓存找到对象则添加进缓存中
}
}
catch { }
}
return (Maticsoft.Model.Shop.Products.BrandInfo)objModel;
清空全部缓存