Here is an example:
Reversing a Condition with the Not Operator
This example introduces the EntityBooleanOp.NOT operator, which reverses the sense of a condition. Like the OR operator, the NOT operator is applied after the clause to which it applies has been defined.
C# |
#region Name Does ! (Contains the Letter 'E')
/// <remarks>
/// select * from "dbo"."Product" where (( not "dbo"."Product"."ProductName" like ?))
/// Params: v0=%E%
/// </remarks>
internal static RdbQuery GetQueryNameDoesNotContainsE() {
RdbQuery query = new RdbQuery(typeof(Product));
query.AddClause(Product.ProductNameEntityColumn, EntityQueryOp.Contains, "E");
query.AddOperator(EntityBooleanOp.Not);
return query;
}
#endregion
|
VB |
#Region "Name Does NOT Contains the Letter 'E'"
''' <remarks>
''' select * from "dbo"."Product" where (( not "dbo"."Product"."ProductName" like ?))
''' Params: v0=%E%
''' </remarks>
Friend Shared Function GetQueryNameDoesNotContainsE() As RdbQuery
Dim query As New RdbQuery(GetType(Product))
query.AddClause(Product.ProductNameEntityColumn, EntityQueryOp.Contains, "E")
query.AddOperator(EntityBooleanOp.Not)
Return query
End Function
#End Region
|