private bool LoadByPrimaryKeyDynamic(System.Int32 productId, System.Int32 relatedProductId)
        {
            RelatedProductQuery query = new RelatedProductQuery();

            query.Where(query.ProductId == productId, query.RelatedProductId == relatedProductId);
            return(this.Load(query));
        }
        protected void InitQuery(RelatedProductQuery query)
        {
            query.OnLoadDelegate = this.OnQueryLoaded;

            if (!query.es2.HasConnection)
            {
                query.es2.Connection = ((IEntityCollection)this).Connection;
            }
        }
Example #3
0
        public List <Product> GetRelatedProducts()
        {
            ProductQuery        p  = new ProductQuery("p");
            RelatedProductQuery rp = new RelatedProductQuery("rp");

            p.Select(p).InnerJoin(rp).On(p.Id == rp.RelatedProductId);
            p.Where(rp.ProductId == this.Id.Value);

            ProductCollection collection = new ProductCollection();

            collection.Load(p);

            return(collection.ToList());
        }
 public bool Load(RelatedProductQuery query)
 {
     this.query = query;
     InitQuery(this.query);
     return(Query.Load());
 }