Use a custom property in a PredicateExpression

Posts   
 
    
kal
User
Posts: 18
Joined: 25-May-2010
# Posted on: 27-Jan-2011 15:29:27   

Hi people,

I've defined a custome property to an entity class :


        #region Custom Entity code
        
        // __LLBLGENPRO_USER_CODE_REGION_START CustomEntityCode
        public string FullDescription
        {
            get
            {
                return this.Nom + " " + this.Prenom;
            }
        }
        // __LLBLGENPRO_USER_CODE_REGION_END

        #endregion

Is it possible to use this custom property in a PredicateExpression ?

Currently, this custom property doesn't appear in the related EntityFields class...

Thanks in advance! Kal

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 27-Jan-2011 21:33:07   

It's not possible to use in a query against the database as the db will not know what to do with it. It can be used in memory to filter EntityViews etc. See the documentation about DelegatePredicates http://www.llblgen.com/documentation/2.6/Using%20the%20generated%20code/SelfServicing/Filtering%20and%20Sorting/gencode_filteringpredicateclasses.htm#DelegatePredicate

Matt

kal
User
Posts: 18
Joined: 25-May-2010
# Posted on: 28-Jan-2011 16:42:03   

MTrinder wrote:

It's not possible to use in a query against the database as the db will not know what to do with it. It can be used in memory to filter EntityViews etc. See the documentation about DelegatePredicates http://www.llblgen.com/documentation/2.6/Using%20the%20generated%20code/SelfServicing/Filtering%20and%20Sorting/gencode_filteringpredicateclasses.htm#DelegatePredicate

Matt

This is exactly what I was looking for, thanks a lot !!!

Cheers, Kal