开发者

llblgen: How do i filter?

开发者 https://www.devze.com 2022-12-11 23:33 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消