Help Converting from 1.0 to 2.5

Posts   
 
    
Wingnut
User
Posts: 8
Joined: 20-Apr-2005
# Posted on: 18-Sep-2007 23:34:57   

Just downloaded most recent version of software and need help converting my code that uses predicates. I understand much has changed with 2.5 and predicates, however, I am hoping someone can help me troubleshott this simple code;

        Dim thisproduct As New CollectionClasses.Ld_ins_productCollection
        Dim mypredicate As New PredicateExpression
        mypredicate.Add(PredicateFactory.CompareValue(Ld_ins_productFieldIndex.DHIDNum, ComparisonOperator.Equal, thisprop.DHIDNum))
        thisproduct.DeleteMulti(mypredicate)

How can I convert this to 2.5 using self-servicing?

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 19-Sep-2007 04:49:06   

Hi Wingnut,

Since 2.0 you can use native language contstructs to create predicate expressions:

Dim thisproduct As New CollectionClasses.Ld_ins_productCollection
Dim mypredicate As New PredicateExpression
mypredicate.Add(Ld_ins_productFields.DHIDNum = thisprop.DHIDNum)
thisproduct.DeleteMulti(mypredicate)

For more info read LLBLGenPro Help (v2.5) - Using generated code - SelfServicing - Filtering and Sorting - The predicate system

Regards.

David Elizondo | LLBLGen Support Team