llblgen: How do i filter?

1.8k Views Asked by At

Im having some problems with filtering data with LLBLGen. I have an EmployeeEntity where i want to fetch the data filtering by string CustomerNumber. CustomerNumber is not Primary Key. I guess i have to use the IPredicateExpression, but how?

EDIT: Im using the Adapter Model.

3

There are 3 best solutions below

0
On BEST ANSWER

You'll need to do something like this:

IRelationPredicateBucket bucket = new RelationPredicateBucket();
bucket.PredicateExpression.Add(EmployeeFields.CustomerNumber == "123");

You can find a much more in-depth discussion here.

0
On

You can fetch lists using DataAccessAdapter.FetchEntities. The filtering can be done via PredicateExpressions. A nice documentation of the predicate system can be found here.

3
On
EmployeeCollection employees = new EmployeeCollection();
employees.GetMulti(EmployeeFields.CustomerNumber == "123");