Staged Native Language Constrction?

Posts   
 
    
jshallard
User
Posts: 62
Joined: 23-Mar-2005
# Posted on: 06-Sep-2006 13:41:25   

Using Native Language Construction, is it possible to split the construction of a predicate expressions into several stages? For example:

IPredicateExpression pex = ((Table1Fields.Foo == "One") & (Table1Fields.Bar == "Two"))

pex = pex & (Table2Fields.Bar2 == "Three"); // problems code

Thanks for any help

mihies avatar
mihies
User
Posts: 800
Joined: 29-Jan-2006
# Posted on: 06-Sep-2006 13:58:33   

pex.Add/AddWithAnd/AddWithOr

jshallard
User
Posts: 62
Joined: 23-Mar-2005
# Posted on: 06-Sep-2006 15:03:19   

When i use pex.Add() with Native Language Construction, I get the following error message:

The call is ambiguous between the following methods or properties: 'SD.LLBLGen.Pro.ORMSupportClasses.EntityField.operator ==(SD.LLBLGen.Pro.ORMSupportClasses.EntityField, System.Collections.IList)' and 'SD.LLBLGen.Pro.ORMSupportClasses.EntityField.operator ==(SD.LLBLGen.Pro.ORMSupportClasses.EntityField, SD.LLBLGen.Pro.ORMSupportClasses.Expression)...

The code i am using is:

pex.Add(TableFields.TableField == null);
Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 06-Sep-2006 15:10:21   

You should compare to "System.DBNull.Value"

pex.Add(TableFields.TableField == System.DBNull.Value);

Please refer to the "FieldCompareNullPredicate" in the LLBLGen Pro manual.

jshallard
User
Posts: 62
Joined: 23-Mar-2005
# Posted on: 06-Sep-2006 15:27:56   

Great - it works!

Thanks