/// <summary> /// 获取相应层级子节点 /// </summary> /// <returns></returns> public DynamicAuth[] GetSubs() { int currLevel = this.PathLevel.GetValueOrDefault(); ICriterion crit = Expression.Gt("PathLevel", currLevel); return(DynamicAuth.FindAll(crit)); }
/// <summary> /// 获取相应层级子节点 /// </summary> /// <param name="level">当前层级向下层级</param> /// <returns></returns> public DynamicAuth[] GetSubs(int level) { int currLevel = this.PathLevel.GetValueOrDefault(); int maxLevel = this.PathLevel.GetValueOrDefault() + level; DetachedCriteria crits = DetachedCriteria.For <DynamicAuth>(); crits.Add(Expression.Gt("PathLevel", currLevel)); crits.Add(Expression.Le("PathLevel", maxLevel)); return(DynamicAuth.FindAll(crits)); }