Relational Operators

Equals
context.Where(x => x.CommonName == "John Doe");
//filter: (cn=John Doe)
Not Equals
context.Where(x => x.CommonName != "John Doe");
//filter: (!(cn=John Doe))
Greater Than Or Equal
context.Where(x => x.EmployeeId >= 2);
//filter: (employeeid>=2)
Greater Than
context.Where(x => x.EmployeeId > 2);
//filter: (&(employeeid>=2)(!(employeedid=2)))
Less Than Or Equal
context.Where(x => x.EmployeeId <= 2);
//filter: (employeeid<=2)
Less Than
context.Where(x => x.EmployeeId < 2);
//filter: (&(employeeid<=2)(!(employeedid=2)))
Negation
context.Where(x => !(x.EmployeeId == 2));
//filter: (!(employeedid=2))
Lazy Boolean
context.Where(x => x.IsActive);
//filter: (isactive=TRUE)
Lazy Boolean Negation
context.Where(x => !x.IsActive);
//filter: (isactive=FALSE)

Last edited Jun 12, 2012 at 1:42 AM by MadHatter22, version 4