PredicateFactoryClassGenerator for v3.0

Posts   
 
    
mmarkaryan
User
Posts: 8
Joined: 08-Jun-2010
# Posted on: 08-Jun-2010 13:31:17   

Hi All,

We are using LLBLGEN v2.6 in our project. After the v3.0 migration, we realized that there is no related task for SD.Tasks.Generic.PredicateFactoryClassGenerator under the task queue to execute. We are currently using PredicateFactory.CompareValue filter options in our project. Could you help me how can I generate PredicateFactory classes into v3.0.

Thanks,

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39833
Joined: 17-Aug-2003
# Posted on: 08-Jun-2010 13:53:58   

The predicate factory was marked as deprecated in v2.0, and in 3.0 we removed deprecated code.

If you want to add the factory again, which is NOT recommended (it's recommended to migrate your own code instead.), simply copy the template to the shared templates folder and add a template binding to a new templatebindings file and add a task to the preset you're using which consumes that TDL template. (presets are xml, so you can also drag both old and new presets from windows explorer onto the designer to open them in XML format and copy over the xml for the task). Again, it's recommended to migrate your code.

For example, to compare the Customer field ' Country' with "India", do:

IPredicate predicate = CustomerFields.Country=="India";

this will create a field compare value predicate, similar to the predicate factory's CompareValue method.

Frans Bouma | Lead developer LLBLGen Pro