Exemple #1
0
        internal IEnumerable <Database.IRelationship> Select(Model.Queries.Relationship Query)
        {
            String sql = "select " + this.ColumnsSQL + " from " + this.TablesSQL;

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

            return(this.SelectRelationships(sql));
        }
Exemple #2
0
        public IEnumerable <IRelationship> Get(Model.Queries.Relationship Query)
        {
            this.Load();

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

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

            return(ret);
        }
 public IEnumerable <IRelationship> Get(Model.Queries.Relationship Query)
 {
     return(this.TableCache[Query.ItemType].Select(Query));
 }