Skip to content

Relational Operators

Alan Hatter edited this page Jun 13, 2020 · 1 revision

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)

Clone this wiki locally