Hi,
I got into problem of predicate And operator. Code is :
SQLDBDataContext sqlDS = new SQLDBDataContext();
Expression<Func<User,bool>> pred = null; //delcare the predicate to start with.
if (Request["Name"] != null && ! Request["Name"].Equals(string.Empty))
{
pred = c => ( c.ContactFirst.Contains(Request["Name"]) || c.ContactLast.Contains(Request["Name"]));
}
if (Request["Company"] != null && !Request["Company"].Equals(string.Empty))
{
if (pred == null) {
pred = (c => c.Company.Contains(Request["Company"]));
}
else {
pred = pred.And(c => c.Company.Contains(Request["Company"]));
}
}
error is line : [ else {pred = pred.And(c => ] No overload for method 'And' takes '1' arguments
Can anybody tell me how to use .And operator to predicate.
Thanks in advance.
Anil