Exemple #1
0
        public DynamicTableObject[] take(int count)
        {
            var query = new 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));
        }
Exemple #2
0
        public DynamicTableObject[] findAll(string condition)
        {
            var list = this.table.Query.FindAll(condition);

            return(DynamicTableObject.CreateList(list.ToArray(), this.table, this.context));
        }
Exemple #3
0
        public DynamicTableObject[] all()
        {
            var all = this.table.All();

            return(DynamicTableObject.CreateList(all.ToArray(), this.table, this.context));
        }
Exemple #4
0
        public DynamicTableObject[] findAll(string field, object value)
        {
            var list = this.table.Query.Where(field, IndexedDB.Query.Comparer.EqualTo, value).SelectAll();

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