Hello,
We're demoing llbl for a new project. I have been playing with LLBLGenPro 2.5/VS 2008/Adapter model for the last week or so and have a few questions in regards databinding on a web form.
I've seen how people are manually using the PerformSelect() method on a LLBLDataSource, but I want to expand on that a little bit.
Currently, I have a Facade to my LLBLGen stuff, which uses the prefetch Path pattern. This facade has a method called GetCustomerAndOrders(int CustomerPK) which returns a CustomerEntity with a populated collection Property(of type EntityCollection<orderEntity>) called orders. Note: in the future, I will expand on this method to return more than just an orders collection..maybe order details, etc.
CustomerEntity cust = GetCustomerAndOrders(10); //cust.Orders will be a populated graph
My question is, how would you, the pros, go about binding to the CustomerEntity and its corresponding Orders property while using my the GetCustomerAndOrders method? Would you use multiple LLBL DataSource controls? Would you bind at one and only event handler? Something like this?:
protected void llblDSCustomers_PerformSelect(object sender, SD.LLBLGen.Pro.ORMSupportClasses.PerformSelectEventArgs2 e)
{
llblDSCustomers.EntityCollection = PermitMaintenance.GetCustomers(10);
}
I've seen some threads on this forum about binding at design time, which I know we can't do, but I don't see any examples of my scenario.
Also, I know the syntax for prefetching is: da.FetchEntity(customer, prefetchPath);
Lets say we already have a fully instantiated customer entity and do not require a DB lookup for the customer(root), but we do require a DB lookup for all of the prefetched paths - is it possible to bypass a DB lookup for the customer?
This is a long post, I know, and will gladly expand if needed.
Thanks a lot!!