lad4bear wrote:
Hi Guys,
Can someone explain to me what is going on in the following code (taken from the Using The Generated Code -> Adapter ->Using the Typed List Classes section of the help files)
IRelationPredicateBucket bucket = (IRelationPredicateBucket)orderCustomer.GetRelationInfo();
bucket.PredicateExpression.Add(PredicateFactory.CompareValue(CustomerFieldIndex.Country, ComparisonOperator.Equal, "Brazil"));
ISortExpression sorter = new SortExpression(SortClauseFactory.Create(OrderFieldIndex.OrderId, SortOperator.Ascending));
What is an IRelationPredicateBucket? And why does it need to know the Relations in the TypedList?
Am finding it a little baffling
Cheers, Pete (aka lad4bear)
LLBLGen Reference Manual says:
Interface definition for a bucket class which contains both a predicate expression and a relation collection which are related to each other (the predicate expression works in combination with the relation collection's contents). Used in adapter's context however can also be used in other situations, for example custom templates.
But that probably doesn't answer your question.
Think of the predicate bucket as a container of "Where clauses" In this case, the example is returning a list of orderCustomer rows, but it wants to limit the result set based on related values found in the Customer table. The prediate expression uses the known relationship between orderCustomer and Customer to limit the result set.