Forum:  LLBLGen Pro Runtime Framework

Thread:  How to add filter for custom property

Viresh (User)   Posted on: 02-Sep-2008 11:03:59.

I'm having one custom property (e.g. IsCompleted) in entity class (e.g. Job entity) written between custom entity code. I want to add filter on this condition. How can I achieve that? I want to do something like:

Walaa (Support Team)   Posted on: 02-Sep-2008 11:15:46.
filter.PredicateExpression.Add(new EntityProperty("IsCompleted") == true);

Viresh (User)   Posted on: 02-Sep-2008 11:37:37.
Thanks walaa for yr reply. But it's complaining about type cast. Can't figure out what it accepts?

Unable to cast object of type 'SD.LLBLGen.Pro.ORMSupportClasses.EntityProperty' to type 'SD.LLBLGen.Pro.ORMSupportClasses.IEntityField2'.
Walaa (Support Team)   Posted on: 02-Sep-2008 12:18:35.
If you are trying to filter on the database side on an entity property that's not mapped to a database field, this won't work. But rathe you should filter on the client side an EntityView.

Viresh (User)   Posted on: 02-Sep-2008 12:47:24.
You're right. It's a user defined property which is not mapped with database field.

I achieved that using EntityView. Thanks Walaa.