IdeaBlade DevForce 2010 Help Reference
And Method
See Also  Example Send Feedback
IdeaBlade.Linq Assembly > IdeaBlade.Linq Namespace > DynamicQueryExtensions Class : And Method



predicate
other
PrecicateDescription to be ANDed with the current predicate
Returns CompositePredicateDescription which represents a conditional AND operation of the current PredicateDescription with another.

Syntax

Visual Basic (Declaration) 
<ExtensionAttribute()>
Public Shared Function And( _
   ByVal predicate As IPredicateDescription, _
   ByVal other As IPredicateDescription _
) As CompositePredicateDescription
Visual Basic (Usage)Copy Code
Dim predicate As IPredicateDescription
Dim other As IPredicateDescription
Dim value As CompositePredicateDescription
 
value = DynamicQueryExtensions.And(predicate, other)

Parameters

predicate
other
PrecicateDescription to be ANDed with the current predicate

Return Value

A CompositePredicateDescription representing multiple predicates

Exceptions

ExceptionDescription
System.ExceptionPredicateDescriptions 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

© 2013 All Rights Reserved.