示例#1
0
            /// <summary>
            /// 根据条件查找
            /// </summary>
            /// <returns></returns>
            public List <Entity> Query(Exp exp, ListArgs arg)
            {
                var list = from row in _data
                           where exp == null || exp.IsMatch(row.Value.Data)
                           //// TODO: orderby 如何处理?
                           select row.Value;

                return(((arg != null) ? list.Skip(arg.Skip).Take(arg.Max) : list).ToList());
            }
示例#2
0
 public IEnumerable <T> Query <T>(Exp exp = null, ListArgs arg = null)
 {
     return(_provider.Query <T>(exp, arg));
 }
示例#3
0
        public virtual IEnumerable <T> Query <T>(Exp exp, ListArgs arg)
        {
            var list = DataSet[_zone].Query(typeof(T), exp, arg);

            return(list.Select(o => (T)o.Data));
        }
示例#4
0
 /// <summary>
 /// 根据条件查找
 /// </summary>
 /// <param name="type"></param>
 /// <param name="exp"></param>
 /// <param name="arg"></param>
 /// <returns></returns>
 public List <Entity> Query(Type type, Exp exp, ListArgs arg)
 {
     return(!_data.ContainsKey(type) ? new List <Entity>() : _data[type].Query(exp, arg));
 }