工作中经常用到的linq根据传入数据集合查询对应子级数据,整理共享,希望大家都能用得上,代码中doublesArray 为父节点对应ID数据集合,再根据ID数据集合查询全部子级数据。
//获取缓存数据
object obj = Caching.GetCache(CacheKey + UModel.RoleId);
if (obj != null)//判读缓存数据是否null
{
SysFunList = (DataSet)obj;
}
else
{
string strSql = "select * from View_SysRoleList where LoginID='" + UModel.LoginId + "' order by [Custom