Thanks. It works indeed, but it requires a lot of code to do a very simple thing.
This brings me to the following question:
Are there any plans to implement some kind of expression parser in LLBLGen Pro ? It would be nice if we could write filter or sort expressions in SQL-like syntax.
For example, instead of:
IPredicateExpression p = new PredicateExpression();
p.Add(PredicateFactory.Like(LicenseFieldIndex.Description,"%" + strSearch + "%"))
p.AddWithOr(PredicateFactory.Like(LicenseFieldIndex.LicNr,"%" + strSearch + "%");
return LicInternCollection.GetMultiAsDataTable ( p , 0 ,
new SortExpression(SortClauseFactory.Create(LicenseFieldIndex.LicNr,SortOperator.Ascending))
) ;
We could use:
return LicInternCollection.GetMultiAsDataTable( "License.Description LIKE '%" + strSearch + "%' or License.LicNr like '%" + strSearch + "%'" , 0 , "License.LicNr ASC");
Similar constructs are possible in a number of other ORM mappers.