DevForce Help Reference
And<T>(Expression<Func<T,Boolean>>,Expression<Func<T,Boolean>>) Method
Example 


First operand
Second operation
Returns an expression which represents a conditional AND operation.
Syntax

Parameters

left
First operand
right
Second operation

Type Parameters

T
Remarks
The resulting expression is an "AndAlso" binary expression, where the second operand will be evaluated only if the first operand is true.
Example
public void AndQuery() {
  var mgr = new DomainModelEntityManager();
  Expression<Func<Customer, bool>> crit1 = c => c.Country.Equals("Mexico");
  Expression<Func<Customer, bool>> crit2 = c => c.CompanyName.StartsWith("A");

  // Where companyname starts with A and country = mexico
  var finalcrit = crit1.And(crit2);
  var query = mgr.Customers.Where(finalcrit);
  var list = query.ToList();
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

PredicateBuilder Class
PredicateBuilder Members
Overload List

Send Feedback