예제 #1
0
        internal IEnumerable <Database.IItem> Select(Model.Queries.Item Query)
        {
            String sql = "select " + this.ColumnsSQL + " from " + this.TablesSQL;

            if (Query.Condition != null)
            {
                sql += " where ((" + this.RootItemTableName + ".superceded=-1) and (" + this.ConditionSQL(Query.Condition) + "))";
            }
            else
            {
                sql += " where (" + this.RootItemTableName + ".superceded=-1)";
            }

            return(this.SelectItems(sql));
        }
예제 #2
0
        public IEnumerable <IItem> Get(Model.Queries.Item Query)
        {
            this.Load();

            List <Item> ret = new List <Item>();

            if (this.ItemCache.ContainsKey(Query.ItemType))
            {
                foreach (Item item in this.ItemCache[Query.ItemType].Values)
                {
                    if (item.MatchQuery(Query))
                    {
                        ret.Add(item);
                    }
                }
            }

            return(ret);
        }
예제 #3
0
 public IEnumerable <IItem> Get(Model.Queries.Item Query)
 {
     return(this.TableCache[Query.ItemType].Select(Query));
 }