本文整理汇总了C#中IConstraint.Smaller方法的典型用法代码示例。如果您正苦于以下问题:C# IConstraint.Smaller方法的具体用法?C# IConstraint.Smaller怎么用?C# IConstraint.Smaller使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IConstraint
的用法示例。
在下文中一共展示了IConstraint.Smaller方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ApplyOperator
public IConstraint ApplyOperator(IConstraint cons, string db4oOperator)
{
try
{
switch (db4oOperator)
{
case BusinessConstants.CONDITION_STARTSWITH:
cons.StartsWith(false);
break;
case BusinessConstants.CONDITION_ENDSWITH:
cons.EndsWith(false);
break;
case BusinessConstants.CONDITION_EQUALS:
cons.Equal();
break;
case BusinessConstants.CONDITION_NOTEQUALS:
cons.Not();
break;
case BusinessConstants.CONDITION_GREATERTHAN :
cons.Greater();
break;
case BusinessConstants.CONDITION_GREATERTHANEQUAL:
cons.Greater().Equal();
break;
case BusinessConstants.CONDITION_LESSTHAN :
cons.Smaller();
break;
case BusinessConstants.CONDITION_LESSTHANEQUAL:
cons.Smaller().Equal();
break;
case BusinessConstants.CONDITION_CONTAINS:
cons.Like();
break;
}
return cons;
}
catch (Exception oEx)
{
LoggingHelper.HandleException(oEx);
return null;
}
}
示例2: Visit
public virtual void Visit(ComparisonExpression expression)
{
IQuery subQuery = Descend(expression.Left());
ComparisonQueryGeneratingVisitor visitor = new ComparisonQueryGeneratingVisitor(_predicate
, _classSource, _referenceResolver);
expression.Right().Accept(visitor);
_constraint = subQuery.Constrain(visitor.Value());
ComparisonOperator op = expression.Op();
if (op.Equals(ComparisonOperator.ValueEquality))
{
return;
}
if (op.Equals(ComparisonOperator.ReferenceEquality))
{
_constraint.Identity();
return;
}
if (op.Equals(ComparisonOperator.Greater))
{
_constraint.Greater();
return;
}
if (op.Equals(ComparisonOperator.Smaller))
{
_constraint.Smaller();
return;
}
if (op.Equals(ComparisonOperator.Contains))
{
_constraint.Contains();
return;
}
if (op.Equals(ComparisonOperator.StartsWith))
{
_constraint.StartsWith(true);
return;
}
if (op.Equals(ComparisonOperator.EndsWith))
{
_constraint.EndsWith(true);
return;
}
throw new Exception("Can't handle constraint: " + op);
}