FieldLikePredicate -- using string instead of EntityField2

Posts   
 
    
Posts: 1
Joined: 22-Nov-2009
# Posted on: 22-Nov-2009 04:55:15   

Hi,

Here's what i am trying to do I need to get the row for which the pattern matches the string passed i.e. one of the column has the pattern stored in each row which would match the string passed. In sql i was using LIKE ( where "String" LIKE TableName.ColumnName)

When i try the same in LLBLGenpro using 2.6, predicate, adapter I am creating the filter (predicate expression) using

String % TableNameFields.ColumnName

i get the following error Operator '%' cannot be applied to operands of type 'string' and 'SD.LLBLGen.Pro.ORMSupportClasses.EntityField2'

I am new to llglgenpro so not sure whether this can be handeled using GenPro or i should loop through the collection returned and try find a match (in my C#, asp.net code)?

The reason i dont want to loop through is that in our DB the pattern is saved with "%" so that our legacy system using sql could do the like and not allowed to be updated as the legacy system and new system are going to run in parallel for a while simple_smile .

Any directions or suggestiosn are appreciated. Thanks.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 22-Nov-2009 21:32:49   

This is an edge case. You should create your own FieldReversePredicateExpression for that. Here is an example of such implementation: http://llblgen.com/tinyforum/Messages.aspx?ThreadID=14430

David Elizondo | LLBLGen Support Team