views:

290

answers:

3

Hello,

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.

A: 
EmployeeCollection employees = new EmployeeCollection();
employees.GetMulti(EmployeeFields.CustomerNumber == "123");
cxfx
Which namespace should i include to get the GetMulti function?
Poku
GetMulti() is a method of the CollectionClasses.EmployeeCollection object. This example is using LLBLGen's Self Service model, so if you're using the Adapter model then the solution will be different.
cxfx
im using the Adapter Model. Can you give an example with this?
Poku
+1  A: 

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.

mlenarz
A: 

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.

Vinz