using System;
using System.Collections.Generic;
using CB.Cache;
using CB.Entity;
namespace CB.Data
{
///
/// 前段调用缓存体系
///
public partial class Caches
{
///
/// 获取区域列表
///
///
public static IList GetAreaList()
{
var cache = CBCache.GetCacheService();
IList list = cache.GetObject(CacheKeys.AreaList) as IList;
if (null == list)
{
list = AreaService.ToList();
cache.AddObject(CacheKeys.AreaList, list);
}
return list;
}
///
/// 获取区域详细
///
///
///
public static AreaInfo GetAreaInfo(int aid)
{
var list = GetAreaList();
if (null == list || 0 >= list.Count)
return null;
AreaInfo entity = null;
foreach (var item in list)
{
if (aid == item.Aid)
{
entity = item; break;
}
}
return entity;
}
}
}