Returns
CompositePredicateDescription which represents a conditional AND operation of the current
PredicateDescription with another.
Syntax
Parameters
- predicate
- other
- PrecicateDescription to be ANDed with the current predicate
Return Value
A CompositePredicateDescription representing multiple predicates
Exceptions
Exception | Description |
System.Exception | PredicateDescriptions can only be combined if their InstanceTypes are the same |
Example
C# | Copy Code |
---|
public void DynamicQueryAnd() {
var baseQuery = EntityQuery.Create(typeof(Customer));
var expr1 = new PredicateDescription("Country", FilterOperator.IsEqualTo, "Mexico");
var expr2 = new PredicateDescription("CompanyName", FilterOperator.StartsWith, "A");
var list = manager.ExecuteQuery(baseQuery.Where(expr1.And(expr2)));
} |
Requirements
Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family
See Also