예제 #1
0
        public IDynamicTableObject[] take(int count)
        {
            var query = new Kooboo.IndexedDB.Dynamic.Query(this.ktable.table);

            if (!string.IsNullOrEmpty(this.SearchCondition))
            {
                var filter = query.ParserFilter(this.SearchCondition);
                query.items = filter;
            }
            else
            {
                //throw new Exception("You do not any search condition");
            }

            if (!string.IsNullOrEmpty(this.OrderByField))
            {
                if (this.Ascending)
                {
                    query.OrderByAscending(this.OrderByField);
                }
                else
                {
                    query.OrderByDescending(this.OrderByField);
                }
            }

            var result = query.Skip(this.skipcount).Take(count).ToArray();

            return(DynamicTableObject.CreateList(result, this.ktable.table, this.ktable.context));
        }
예제 #2
0
파일: KTable.cs 프로젝트: vebin/Kooboo
        public IDynamicTableObject[] all()
        {
            var all = this.table.All();

            return(DynamicTableObject.CreateList(all.ToArray(), this.table, this.context));
        }
예제 #3
0
파일: KTable.cs 프로젝트: vebin/Kooboo
        public IDynamicTableObject[] findAll(string query)
        {
            var list = this.table.Query.FindAll(query);

            return(DynamicTableObject.CreateList(list.ToArray(), this.table, this.context));
        }
예제 #4
0
파일: KTable.cs 프로젝트: vebin/Kooboo
        public IDynamicTableObject[] findAll(string field, object value)
        {
            var list = this.table.Query.Where(field, Kooboo.IndexedDB.Query.Comparer.EqualTo, value).SelectAll();

            return(DynamicTableObject.CreateList(list.ToArray(), this.table, this.context));
        }