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.
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.
EmployeeCollection employees = new EmployeeCollection();
employees.GetMulti(EmployeeFields.CustomerNumber == "123");
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.
精彩评论